[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-nvidia-udf-convert-to-cudf":3,"mdc-dko8hr-key":37,"related-org-nvidia-udf-convert-to-cudf":894,"related-repo-nvidia-udf-convert-to-cudf":1055},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":32,"sourceUrl":35,"mdContent":36},"udf-convert-to-cudf","convert Spark UDFs to GPU-accelerated RapidsUDFs","Assists with converting an Apache Spark UDF to a GPU-accelerated RapidsUDF using cuDF Java APIs. This is step 2 of 3 in the UDF conversion workflow (udf-gen-test -> udf-convert-to-cudf -> udf-benchmark). Use this skill when you have a CPU UDF with a unit test and need to convert it to a RapidsUDF.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},"nvidia","NVIDIA","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fnvidia.png",[12,16,17,20],{"name":13,"slug":14,"type":15},"Java","java","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"Engineering","engineering",{"name":21,"slug":22,"type":15},"Spark","spark",987,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fcudf-spark","2026-07-14T05:30:54.048693","CC-BY-4.0 AND Apache-2.0",289,[29,30,31,22],"big-data","gpu","rapids",{"repoUrl":24,"stars":23,"forks":27,"topics":33,"description":34},[29,30,31,22],"Spark RAPIDS plugin - accelerate Apache Spark with GPUs","https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fcudf-spark\u002Ftree\u002FHEAD\u002Fskills\u002Fudf-convert-to-cudf","---\nname: udf-convert-to-cudf\ndescription: Assists with converting an Apache Spark UDF to a GPU-accelerated RapidsUDF using cuDF Java APIs. This is step 2 of 3 in the UDF conversion workflow (udf-gen-test -> udf-convert-to-cudf -> udf-benchmark). Use this skill when you have a CPU UDF with a unit test and need to convert it to a RapidsUDF.\nlicense: CC-BY-4.0 AND Apache-2.0\nmetadata:\n  spdx-file-copyright-text: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\nmodel: inherit\n---\n\n# Convert UDF to cuDF RapidsUDF\n\n## Workflow\n\n- [ ] Step 1: Create the RapidsUDF file\n- [ ] Step 2: Implement the `evaluateColumnar` method\n- [ ] Step 3: Build and test\n- [ ] Step 4: Check for memory leaks\n- [ ] Step 5: Run judge subagent if requested\n- [ ] Step 6: Review conversion\n\n**Before making any edits, create a visible TODO checklist for every workflow step in this skill and keep it updated.** Do not produce a final answer until every required checklist item is marked complete.\n\n## Prerequisites\n\n- Project directory from Step 1 (udf-gen-test) with passing unit test\n\nDerive `\u003CCamelName>` and `\u003Csnake_name>` from the UDF class name.\n\n> **Note:** Commands require access to `\u002Ftmp` (Spark temp storage) and `\u002Fdev` (GPU device). If commands fail due to sandbox restrictions, re-run them unsandboxed.\n\n## Step 1: Create the RapidsUDF File\n\nCreate a copy of the original UDF file in the same source directory (`src\u002Fmain\u002F\u003Cjava|scala>\u002Fcom\u002Fudf\u002F`), then modify it:\n\n1. Add imports:\n    Java: `import ai.rapids.cudf.*;`, `import com.nvidia.spark.RapidsUDF;`\n    Scala: `import ai.rapids.cudf._`, `import com.nvidia.spark.RapidsUDF`, `import Arm.{withResource, closeOnExcept}`\n2. Add `implements RapidsUDF` to the class declaration\n3. Add the `evaluateColumnar` method stub:\n    Java: `public ColumnVector evaluateColumnar(int numRows, ColumnVector... args) { }`\n    Scala: `def evaluateColumnar(numRows: Int, args: ColumnVector*): ColumnVector = { }`\n4. Rename the class and the file to `\u003CCamelName>RapidsUDF`\n\n## Step 2: Implement the `evaluateColumnar` method\n\n### Background\n\n**Read `references\u002FRAPIDS_UDF.md`** for detailed background on:\n- How RapidsUDF and `evaluateColumnar` work\n- Input ColumnVector types and output type mapping\n- Debugging techniques and GPU memory management\n\n**Read `examples\u002F` for example RapidsUDF implementations for the target language.**\n\n### Implementation\n\n1. Clone https:\u002F\u002Fgithub.com\u002Frapidsai\u002Fcudf (branch matching spark-rapids version) to `~\u002F.cache\u002Faether_agent\u002F` if not already present. Explore `java\u002Fsrc\u002F\u003Cmain|test>\u002Fjava\u002Fai\u002Frapids\u002Fcudf` for relevant methods and usage patterns.\n2. Implement the `evaluateColumnar` method using cuDF APIs.\n\n### Critical Requirements\n\n- **NEVER use `copyToHost()` or methods that copy data GPU→CPU.** This defeats the purpose of GPU acceleration\n- **Do NOT hardcode test values.** The RapidsUDF must implement actual business logic for ANY potential input\n\n## Step 3: Build and Test\n\nFill in the target-specific TODOs in `src\u002Ftest\u002Fscala\u002Fcom\u002Fudf\u002FCudfComparisonTest.scala`:\n- Implement `registerRapidsUDF` to register the new RapidsUDF class.\n- Replace placeholders with the actual camel\u002Fsnake UDF name\n\nThen run the test:\n```bash\nmvn test -Dsuites=com.udf.CudfComparisonTest\n```\n\nIf the test fails, analyze the error and iterate on the RapidsUDF implementation.\n\n### Difficult Test Failures\n\nTreat the unit test as the CPU behavior specification. Do not weaken or remove test cases silently.\n\n- Tests that check for CPU errors may not be directly applicable to a columnar implementation: the GPU path typically evaluates a whole column and may produce nulls for invalid rows instead of throwing row-level exceptions. If this causes an unavoidable mismatch, add a clear comment in the test and a `TODO\u002FNOTE` in the implementation explaining the mismatch.\n- If a test case does not pass because of inherent cuDF\u002Flibcudf\u002FAPI limitations or low-level GPU\u002FCPU semantic differences, comment out the conflicting assertion\u002Ftest only after documenting how you tried to make the behavior match and why those attempts failed. Add a note to the user.\n- If the behavior is important, common, or part of the documented input domain, **always prefer fixing the implementation** over commenting out the test case. The exception is a performance-vs-correctness tradeoff that the user explicitly approves.\n\n## Step 4: Memory Leak Check\n\nRe-run with memory leak detection:\n```bash\nmvn test -Dsuites=com.udf.CudfComparisonTest -Ddebug.memory.leaks=true > \u002Ftmp\u002Fmemleak.log 2>&1\n\n# Check for leaks\ngrep \"LEAKED\" \u002Ftmp\u002Fmemleak.log | head -5\n```\n\nIf leaks are found, ensure all GPU objects are properly closed.\n\n## Step 5: Run Judge Subagent If Requested\n\nIf the user explicitly asked for the judge, a judge subagent, or a review agent, treat that as an explicit request for delegation: you **MUST** launch a separate subagent with `model: inherit` and instruct it to use the **udf-judge-conversion** skill. Ask it to review the `UnitTest`, `CudfComparisonTest`, and RapidsUDF implementation.\n\nIf the user did not request a judge\u002Freview agent, mark this step as skipped and continue to Step 6. If a required judge subagent is blocked by tool policy, stop and tell the user that explicit permission\u002Finstruction is needed.\n\nIf you run the judge, wait for it to complete and review its report. If the judge finds any issues, 1) fix the issues, 2) re-run the tests and leak checks, and 3) re-run the judge subagent.\n\n## Step 6: Review Conversion\n\nReview your own work to ensure:\n- The test runs on the GPU and directly compares CPU-GPU outputs\n- The implementation does not overfit to test cases\n- No `copyToHost()` or row-by-row GPU-to-CPU copying is used for computation\n- No debug statements (e.g., `TableDebug.get().debug(...)`) remain in final output\n\n## Output\n\nUpon successful completion:\n- RapidsUDF file at `src\u002Fmain\u002F\u003Cjava|scala>\u002Fcom\u002Fudf\u002F\u003CCamelName>RapidsUDF.\u003Cjava|scala>`\n- Comparison test passes with no memory leaks\n\nThese outputs are required for **Step 3: Benchmark**.\n",{"data":38,"body":42},{"name":4,"description":6,"license":26,"metadata":39,"model":41},{"spdx-file-copyright-text":40},"Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.","inherit",{"type":43,"children":44},"root",[45,54,61,135,147,153,161,182,212,218,231,325,337,344,360,385,400,406,452,458,489,495,508,529,534,568,573,579,584,617,623,628,734,739,745,787,792,797,803,808,846,852,857,876,888],{"type":46,"tag":47,"props":48,"children":50},"element","h1",{"id":49},"convert-udf-to-cudf-rapidsudf",[51],{"type":52,"value":53},"text","Convert UDF to cuDF RapidsUDF",{"type":46,"tag":55,"props":56,"children":58},"h2",{"id":57},"workflow",[59],{"type":52,"value":60},"Workflow",{"type":46,"tag":62,"props":63,"children":66},"ul",{"className":64},[65],"contains-task-list",[67,81,99,108,117,126],{"type":46,"tag":68,"props":69,"children":72},"li",{"className":70},[71],"task-list-item",[73,79],{"type":46,"tag":74,"props":75,"children":78},"input",{"disabled":76,"type":77},true,"checkbox",[],{"type":52,"value":80}," Step 1: Create the RapidsUDF file",{"type":46,"tag":68,"props":82,"children":84},{"className":83},[71],[85,88,90,97],{"type":46,"tag":74,"props":86,"children":87},{"disabled":76,"type":77},[],{"type":52,"value":89}," Step 2: Implement the ",{"type":46,"tag":91,"props":92,"children":94},"code",{"className":93},[],[95],{"type":52,"value":96},"evaluateColumnar",{"type":52,"value":98}," method",{"type":46,"tag":68,"props":100,"children":102},{"className":101},[71],[103,106],{"type":46,"tag":74,"props":104,"children":105},{"disabled":76,"type":77},[],{"type":52,"value":107}," Step 3: Build and test",{"type":46,"tag":68,"props":109,"children":111},{"className":110},[71],[112,115],{"type":46,"tag":74,"props":113,"children":114},{"disabled":76,"type":77},[],{"type":52,"value":116}," Step 4: Check for memory leaks",{"type":46,"tag":68,"props":118,"children":120},{"className":119},[71],[121,124],{"type":46,"tag":74,"props":122,"children":123},{"disabled":76,"type":77},[],{"type":52,"value":125}," Step 5: Run judge subagent if requested",{"type":46,"tag":68,"props":127,"children":129},{"className":128},[71],[130,133],{"type":46,"tag":74,"props":131,"children":132},{"disabled":76,"type":77},[],{"type":52,"value":134}," Step 6: Review conversion",{"type":46,"tag":136,"props":137,"children":138},"p",{},[139,145],{"type":46,"tag":140,"props":141,"children":142},"strong",{},[143],{"type":52,"value":144},"Before making any edits, create a visible TODO checklist for every workflow step in this skill and keep it updated.",{"type":52,"value":146}," Do not produce a final answer until every required checklist item is marked complete.",{"type":46,"tag":55,"props":148,"children":150},{"id":149},"prerequisites",[151],{"type":52,"value":152},"Prerequisites",{"type":46,"tag":62,"props":154,"children":155},{},[156],{"type":46,"tag":68,"props":157,"children":158},{},[159],{"type":52,"value":160},"Project directory from Step 1 (udf-gen-test) with passing unit test",{"type":46,"tag":136,"props":162,"children":163},{},[164,166,172,174,180],{"type":52,"value":165},"Derive ",{"type":46,"tag":91,"props":167,"children":169},{"className":168},[],[170],{"type":52,"value":171},"\u003CCamelName>",{"type":52,"value":173}," and ",{"type":46,"tag":91,"props":175,"children":177},{"className":176},[],[178],{"type":52,"value":179},"\u003Csnake_name>",{"type":52,"value":181}," from the UDF class name.",{"type":46,"tag":183,"props":184,"children":185},"blockquote",{},[186],{"type":46,"tag":136,"props":187,"children":188},{},[189,194,196,202,204,210],{"type":46,"tag":140,"props":190,"children":191},{},[192],{"type":52,"value":193},"Note:",{"type":52,"value":195}," Commands require access to ",{"type":46,"tag":91,"props":197,"children":199},{"className":198},[],[200],{"type":52,"value":201},"\u002Ftmp",{"type":52,"value":203}," (Spark temp storage) and ",{"type":46,"tag":91,"props":205,"children":207},{"className":206},[],[208],{"type":52,"value":209},"\u002Fdev",{"type":52,"value":211}," (GPU device). If commands fail due to sandbox restrictions, re-run them unsandboxed.",{"type":46,"tag":55,"props":213,"children":215},{"id":214},"step-1-create-the-rapidsudf-file",[216],{"type":52,"value":217},"Step 1: Create the RapidsUDF File",{"type":46,"tag":136,"props":219,"children":220},{},[221,223,229],{"type":52,"value":222},"Create a copy of the original UDF file in the same source directory (",{"type":46,"tag":91,"props":224,"children":226},{"className":225},[],[227],{"type":52,"value":228},"src\u002Fmain\u002F\u003Cjava|scala>\u002Fcom\u002Fudf\u002F",{"type":52,"value":230},"), then modify it:",{"type":46,"tag":232,"props":233,"children":234},"ol",{},[235,276,289,314],{"type":46,"tag":68,"props":236,"children":237},{},[238,240,246,248,254,256,262,263,269,270],{"type":52,"value":239},"Add imports:\nJava: ",{"type":46,"tag":91,"props":241,"children":243},{"className":242},[],[244],{"type":52,"value":245},"import ai.rapids.cudf.*;",{"type":52,"value":247},", ",{"type":46,"tag":91,"props":249,"children":251},{"className":250},[],[252],{"type":52,"value":253},"import com.nvidia.spark.RapidsUDF;",{"type":52,"value":255},"\nScala: ",{"type":46,"tag":91,"props":257,"children":259},{"className":258},[],[260],{"type":52,"value":261},"import ai.rapids.cudf._",{"type":52,"value":247},{"type":46,"tag":91,"props":264,"children":266},{"className":265},[],[267],{"type":52,"value":268},"import com.nvidia.spark.RapidsUDF",{"type":52,"value":247},{"type":46,"tag":91,"props":271,"children":273},{"className":272},[],[274],{"type":52,"value":275},"import Arm.{withResource, closeOnExcept}",{"type":46,"tag":68,"props":277,"children":278},{},[279,281,287],{"type":52,"value":280},"Add ",{"type":46,"tag":91,"props":282,"children":284},{"className":283},[],[285],{"type":52,"value":286},"implements RapidsUDF",{"type":52,"value":288}," to the class declaration",{"type":46,"tag":68,"props":290,"children":291},{},[292,294,299,301,307,308],{"type":52,"value":293},"Add the ",{"type":46,"tag":91,"props":295,"children":297},{"className":296},[],[298],{"type":52,"value":96},{"type":52,"value":300}," method stub:\nJava: ",{"type":46,"tag":91,"props":302,"children":304},{"className":303},[],[305],{"type":52,"value":306},"public ColumnVector evaluateColumnar(int numRows, ColumnVector... args) { }",{"type":52,"value":255},{"type":46,"tag":91,"props":309,"children":311},{"className":310},[],[312],{"type":52,"value":313},"def evaluateColumnar(numRows: Int, args: ColumnVector*): ColumnVector = { }",{"type":46,"tag":68,"props":315,"children":316},{},[317,319],{"type":52,"value":318},"Rename the class and the file to ",{"type":46,"tag":91,"props":320,"children":322},{"className":321},[],[323],{"type":52,"value":324},"\u003CCamelName>RapidsUDF",{"type":46,"tag":55,"props":326,"children":328},{"id":327},"step-2-implement-the-evaluatecolumnar-method",[329,331,336],{"type":52,"value":330},"Step 2: Implement the ",{"type":46,"tag":91,"props":332,"children":334},{"className":333},[],[335],{"type":52,"value":96},{"type":52,"value":98},{"type":46,"tag":338,"props":339,"children":341},"h3",{"id":340},"background",[342],{"type":52,"value":343},"Background",{"type":46,"tag":136,"props":345,"children":346},{},[347,358],{"type":46,"tag":140,"props":348,"children":349},{},[350,352],{"type":52,"value":351},"Read ",{"type":46,"tag":91,"props":353,"children":355},{"className":354},[],[356],{"type":52,"value":357},"references\u002FRAPIDS_UDF.md",{"type":52,"value":359}," for detailed background on:",{"type":46,"tag":62,"props":361,"children":362},{},[363,375,380],{"type":46,"tag":68,"props":364,"children":365},{},[366,368,373],{"type":52,"value":367},"How RapidsUDF and ",{"type":46,"tag":91,"props":369,"children":371},{"className":370},[],[372],{"type":52,"value":96},{"type":52,"value":374}," work",{"type":46,"tag":68,"props":376,"children":377},{},[378],{"type":52,"value":379},"Input ColumnVector types and output type mapping",{"type":46,"tag":68,"props":381,"children":382},{},[383],{"type":52,"value":384},"Debugging techniques and GPU memory management",{"type":46,"tag":136,"props":386,"children":387},{},[388],{"type":46,"tag":140,"props":389,"children":390},{},[391,392,398],{"type":52,"value":351},{"type":46,"tag":91,"props":393,"children":395},{"className":394},[],[396],{"type":52,"value":397},"examples\u002F",{"type":52,"value":399}," for example RapidsUDF implementations for the target language.",{"type":46,"tag":338,"props":401,"children":403},{"id":402},"implementation",[404],{"type":52,"value":405},"Implementation",{"type":46,"tag":232,"props":407,"children":408},{},[409,440],{"type":46,"tag":68,"props":410,"children":411},{},[412,414,422,424,430,432,438],{"type":52,"value":413},"Clone ",{"type":46,"tag":415,"props":416,"children":420},"a",{"href":417,"rel":418},"https:\u002F\u002Fgithub.com\u002Frapidsai\u002Fcudf",[419],"nofollow",[421],{"type":52,"value":417},{"type":52,"value":423}," (branch matching spark-rapids version) to ",{"type":46,"tag":91,"props":425,"children":427},{"className":426},[],[428],{"type":52,"value":429},"~\u002F.cache\u002Faether_agent\u002F",{"type":52,"value":431}," if not already present. Explore ",{"type":46,"tag":91,"props":433,"children":435},{"className":434},[],[436],{"type":52,"value":437},"java\u002Fsrc\u002F\u003Cmain|test>\u002Fjava\u002Fai\u002Frapids\u002Fcudf",{"type":52,"value":439}," for relevant methods and usage patterns.",{"type":46,"tag":68,"props":441,"children":442},{},[443,445,450],{"type":52,"value":444},"Implement the ",{"type":46,"tag":91,"props":446,"children":448},{"className":447},[],[449],{"type":52,"value":96},{"type":52,"value":451}," method using cuDF APIs.",{"type":46,"tag":338,"props":453,"children":455},{"id":454},"critical-requirements",[456],{"type":52,"value":457},"Critical Requirements",{"type":46,"tag":62,"props":459,"children":460},{},[461,479],{"type":46,"tag":68,"props":462,"children":463},{},[464,477],{"type":46,"tag":140,"props":465,"children":466},{},[467,469,475],{"type":52,"value":468},"NEVER use ",{"type":46,"tag":91,"props":470,"children":472},{"className":471},[],[473],{"type":52,"value":474},"copyToHost()",{"type":52,"value":476}," or methods that copy data GPU→CPU.",{"type":52,"value":478}," This defeats the purpose of GPU acceleration",{"type":46,"tag":68,"props":480,"children":481},{},[482,487],{"type":46,"tag":140,"props":483,"children":484},{},[485],{"type":52,"value":486},"Do NOT hardcode test values.",{"type":52,"value":488}," The RapidsUDF must implement actual business logic for ANY potential input",{"type":46,"tag":55,"props":490,"children":492},{"id":491},"step-3-build-and-test",[493],{"type":52,"value":494},"Step 3: Build and Test",{"type":46,"tag":136,"props":496,"children":497},{},[498,500,506],{"type":52,"value":499},"Fill in the target-specific TODOs in ",{"type":46,"tag":91,"props":501,"children":503},{"className":502},[],[504],{"type":52,"value":505},"src\u002Ftest\u002Fscala\u002Fcom\u002Fudf\u002FCudfComparisonTest.scala",{"type":52,"value":507},":",{"type":46,"tag":62,"props":509,"children":510},{},[511,524],{"type":46,"tag":68,"props":512,"children":513},{},[514,516,522],{"type":52,"value":515},"Implement ",{"type":46,"tag":91,"props":517,"children":519},{"className":518},[],[520],{"type":52,"value":521},"registerRapidsUDF",{"type":52,"value":523}," to register the new RapidsUDF class.",{"type":46,"tag":68,"props":525,"children":526},{},[527],{"type":52,"value":528},"Replace placeholders with the actual camel\u002Fsnake UDF name",{"type":46,"tag":136,"props":530,"children":531},{},[532],{"type":52,"value":533},"Then run the test:",{"type":46,"tag":535,"props":536,"children":541},"pre",{"className":537,"code":538,"language":539,"meta":540,"style":540},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","mvn test -Dsuites=com.udf.CudfComparisonTest\n","bash","",[542],{"type":46,"tag":91,"props":543,"children":544},{"__ignoreMap":540},[545],{"type":46,"tag":546,"props":547,"children":550},"span",{"class":548,"line":549},"line",1,[551,557,563],{"type":46,"tag":546,"props":552,"children":554},{"style":553},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[555],{"type":52,"value":556},"mvn",{"type":46,"tag":546,"props":558,"children":560},{"style":559},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[561],{"type":52,"value":562}," test",{"type":46,"tag":546,"props":564,"children":565},{"style":559},[566],{"type":52,"value":567}," -Dsuites=com.udf.CudfComparisonTest\n",{"type":46,"tag":136,"props":569,"children":570},{},[571],{"type":52,"value":572},"If the test fails, analyze the error and iterate on the RapidsUDF implementation.",{"type":46,"tag":338,"props":574,"children":576},{"id":575},"difficult-test-failures",[577],{"type":52,"value":578},"Difficult Test Failures",{"type":46,"tag":136,"props":580,"children":581},{},[582],{"type":52,"value":583},"Treat the unit test as the CPU behavior specification. Do not weaken or remove test cases silently.",{"type":46,"tag":62,"props":585,"children":586},{},[587,600,605],{"type":46,"tag":68,"props":588,"children":589},{},[590,592,598],{"type":52,"value":591},"Tests that check for CPU errors may not be directly applicable to a columnar implementation: the GPU path typically evaluates a whole column and may produce nulls for invalid rows instead of throwing row-level exceptions. If this causes an unavoidable mismatch, add a clear comment in the test and a ",{"type":46,"tag":91,"props":593,"children":595},{"className":594},[],[596],{"type":52,"value":597},"TODO\u002FNOTE",{"type":52,"value":599}," in the implementation explaining the mismatch.",{"type":46,"tag":68,"props":601,"children":602},{},[603],{"type":52,"value":604},"If a test case does not pass because of inherent cuDF\u002Flibcudf\u002FAPI limitations or low-level GPU\u002FCPU semantic differences, comment out the conflicting assertion\u002Ftest only after documenting how you tried to make the behavior match and why those attempts failed. Add a note to the user.",{"type":46,"tag":68,"props":606,"children":607},{},[608,610,615],{"type":52,"value":609},"If the behavior is important, common, or part of the documented input domain, ",{"type":46,"tag":140,"props":611,"children":612},{},[613],{"type":52,"value":614},"always prefer fixing the implementation",{"type":52,"value":616}," over commenting out the test case. The exception is a performance-vs-correctness tradeoff that the user explicitly approves.",{"type":46,"tag":55,"props":618,"children":620},{"id":619},"step-4-memory-leak-check",[621],{"type":52,"value":622},"Step 4: Memory Leak Check",{"type":46,"tag":136,"props":624,"children":625},{},[626],{"type":52,"value":627},"Re-run with memory leak detection:",{"type":46,"tag":535,"props":629,"children":631},{"className":537,"code":630,"language":539,"meta":540,"style":540},"mvn test -Dsuites=com.udf.CudfComparisonTest -Ddebug.memory.leaks=true > \u002Ftmp\u002Fmemleak.log 2>&1\n\n# Check for leaks\ngrep \"LEAKED\" \u002Ftmp\u002Fmemleak.log | head -5\n",[632],{"type":46,"tag":91,"props":633,"children":634},{"__ignoreMap":540},[635,672,681,691],{"type":46,"tag":546,"props":636,"children":637},{"class":548,"line":549},[638,642,646,651,656,662,667],{"type":46,"tag":546,"props":639,"children":640},{"style":553},[641],{"type":52,"value":556},{"type":46,"tag":546,"props":643,"children":644},{"style":559},[645],{"type":52,"value":562},{"type":46,"tag":546,"props":647,"children":648},{"style":559},[649],{"type":52,"value":650}," -Dsuites=com.udf.CudfComparisonTest",{"type":46,"tag":546,"props":652,"children":653},{"style":559},[654],{"type":52,"value":655}," -Ddebug.memory.leaks=true",{"type":46,"tag":546,"props":657,"children":659},{"style":658},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[660],{"type":52,"value":661}," >",{"type":46,"tag":546,"props":663,"children":664},{"style":559},[665],{"type":52,"value":666}," \u002Ftmp\u002Fmemleak.log",{"type":46,"tag":546,"props":668,"children":669},{"style":658},[670],{"type":52,"value":671}," 2>&1\n",{"type":46,"tag":546,"props":673,"children":675},{"class":548,"line":674},2,[676],{"type":46,"tag":546,"props":677,"children":678},{"emptyLinePlaceholder":76},[679],{"type":52,"value":680},"\n",{"type":46,"tag":546,"props":682,"children":684},{"class":548,"line":683},3,[685],{"type":46,"tag":546,"props":686,"children":688},{"style":687},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[689],{"type":52,"value":690},"# Check for leaks\n",{"type":46,"tag":546,"props":692,"children":694},{"class":548,"line":693},4,[695,700,705,710,715,719,724,729],{"type":46,"tag":546,"props":696,"children":697},{"style":553},[698],{"type":52,"value":699},"grep",{"type":46,"tag":546,"props":701,"children":702},{"style":658},[703],{"type":52,"value":704}," \"",{"type":46,"tag":546,"props":706,"children":707},{"style":559},[708],{"type":52,"value":709},"LEAKED",{"type":46,"tag":546,"props":711,"children":712},{"style":658},[713],{"type":52,"value":714},"\"",{"type":46,"tag":546,"props":716,"children":717},{"style":559},[718],{"type":52,"value":666},{"type":46,"tag":546,"props":720,"children":721},{"style":658},[722],{"type":52,"value":723}," |",{"type":46,"tag":546,"props":725,"children":726},{"style":553},[727],{"type":52,"value":728}," head",{"type":46,"tag":546,"props":730,"children":731},{"style":559},[732],{"type":52,"value":733}," -5\n",{"type":46,"tag":136,"props":735,"children":736},{},[737],{"type":52,"value":738},"If leaks are found, ensure all GPU objects are properly closed.",{"type":46,"tag":55,"props":740,"children":742},{"id":741},"step-5-run-judge-subagent-if-requested",[743],{"type":52,"value":744},"Step 5: Run Judge Subagent If Requested",{"type":46,"tag":136,"props":746,"children":747},{},[748,750,755,757,763,765,770,772,778,779,785],{"type":52,"value":749},"If the user explicitly asked for the judge, a judge subagent, or a review agent, treat that as an explicit request for delegation: you ",{"type":46,"tag":140,"props":751,"children":752},{},[753],{"type":52,"value":754},"MUST",{"type":52,"value":756}," launch a separate subagent with ",{"type":46,"tag":91,"props":758,"children":760},{"className":759},[],[761],{"type":52,"value":762},"model: inherit",{"type":52,"value":764}," and instruct it to use the ",{"type":46,"tag":140,"props":766,"children":767},{},[768],{"type":52,"value":769},"udf-judge-conversion",{"type":52,"value":771}," skill. Ask it to review the ",{"type":46,"tag":91,"props":773,"children":775},{"className":774},[],[776],{"type":52,"value":777},"UnitTest",{"type":52,"value":247},{"type":46,"tag":91,"props":780,"children":782},{"className":781},[],[783],{"type":52,"value":784},"CudfComparisonTest",{"type":52,"value":786},", and RapidsUDF implementation.",{"type":46,"tag":136,"props":788,"children":789},{},[790],{"type":52,"value":791},"If the user did not request a judge\u002Freview agent, mark this step as skipped and continue to Step 6. If a required judge subagent is blocked by tool policy, stop and tell the user that explicit permission\u002Finstruction is needed.",{"type":46,"tag":136,"props":793,"children":794},{},[795],{"type":52,"value":796},"If you run the judge, wait for it to complete and review its report. If the judge finds any issues, 1) fix the issues, 2) re-run the tests and leak checks, and 3) re-run the judge subagent.",{"type":46,"tag":55,"props":798,"children":800},{"id":799},"step-6-review-conversion",[801],{"type":52,"value":802},"Step 6: Review Conversion",{"type":46,"tag":136,"props":804,"children":805},{},[806],{"type":52,"value":807},"Review your own work to ensure:",{"type":46,"tag":62,"props":809,"children":810},{},[811,816,821,833],{"type":46,"tag":68,"props":812,"children":813},{},[814],{"type":52,"value":815},"The test runs on the GPU and directly compares CPU-GPU outputs",{"type":46,"tag":68,"props":817,"children":818},{},[819],{"type":52,"value":820},"The implementation does not overfit to test cases",{"type":46,"tag":68,"props":822,"children":823},{},[824,826,831],{"type":52,"value":825},"No ",{"type":46,"tag":91,"props":827,"children":829},{"className":828},[],[830],{"type":52,"value":474},{"type":52,"value":832}," or row-by-row GPU-to-CPU copying is used for computation",{"type":46,"tag":68,"props":834,"children":835},{},[836,838,844],{"type":52,"value":837},"No debug statements (e.g., ",{"type":46,"tag":91,"props":839,"children":841},{"className":840},[],[842],{"type":52,"value":843},"TableDebug.get().debug(...)",{"type":52,"value":845},") remain in final output",{"type":46,"tag":55,"props":847,"children":849},{"id":848},"output",[850],{"type":52,"value":851},"Output",{"type":46,"tag":136,"props":853,"children":854},{},[855],{"type":52,"value":856},"Upon successful completion:",{"type":46,"tag":62,"props":858,"children":859},{},[860,871],{"type":46,"tag":68,"props":861,"children":862},{},[863,865],{"type":52,"value":864},"RapidsUDF file at ",{"type":46,"tag":91,"props":866,"children":868},{"className":867},[],[869],{"type":52,"value":870},"src\u002Fmain\u002F\u003Cjava|scala>\u002Fcom\u002Fudf\u002F\u003CCamelName>RapidsUDF.\u003Cjava|scala>",{"type":46,"tag":68,"props":872,"children":873},{},[874],{"type":52,"value":875},"Comparison test passes with no memory leaks",{"type":46,"tag":136,"props":877,"children":878},{},[879,881,886],{"type":52,"value":880},"These outputs are required for ",{"type":46,"tag":140,"props":882,"children":883},{},[884],{"type":52,"value":885},"Step 3: Benchmark",{"type":52,"value":887},".",{"type":46,"tag":889,"props":890,"children":891},"style",{},[892],{"type":52,"value":893},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":895,"total":1054},[896,914,932,943,955,969,982,996,1009,1020,1034,1043],{"slug":897,"name":897,"fn":898,"description":899,"org":900,"tags":901,"stars":911,"repoUrl":912,"updatedAt":913},"nemoclaw-user-guide","retrieve NemoClaw documentation and configuration","Guides human users' AI agents to the NemoClaw docs MCP server and canonical Fern documentation in Markdown form. Use when users ask how to install, configure, operate, troubleshoot, secure, or learn NemoClaw with an AI coding assistant. Trigger keywords - nemoclaw docs, use nemoclaw with ai agent, nemoclaw mcp docs, nemoclaw install help, nemoclaw quickstart, nemoclaw markdown docs, llms.txt, agent skills.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[902,905,908],{"name":903,"slug":904,"type":15},"Documentation","documentation",{"name":906,"slug":907,"type":15},"MCP","mcp",{"name":909,"slug":910,"type":15},"Search","search",21777,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNemoClaw","2026-07-20T06:00:01.461044",{"slug":915,"name":915,"fn":916,"description":917,"org":918,"tags":919,"stars":929,"repoUrl":930,"updatedAt":931},"mcore-build-and-dependency","manage Megatron-LM development environments","Container-based dev environment setup and dependency management for Megatron-LM. Covers acquiring and launching the CI container, uv package management, and updating uv.lock.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[920,923,926],{"name":921,"slug":922,"type":15},"Containers","containers",{"name":924,"slug":925,"type":15},"Deployment","deployment",{"name":927,"slug":928,"type":15},"Python","python",17049,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FMegatron-LM","2026-07-27T06:06:11.249662",{"slug":933,"name":933,"fn":934,"description":935,"org":936,"tags":937,"stars":929,"repoUrl":930,"updatedAt":942},"mcore-bump-base-image","update NVIDIA PyTorch base images","Bump the NVIDIA PyTorch base image (`nvcr.io\u002Fnvidia\u002Fpytorch:YY.MM-py3`) used by Megatron-LM CI. Covers the two pin sites (GitHub CI in `docker\u002F.ngc_version.dev` and GitLab CI in `.gitlab\u002Fstages\u002F01.build.yml`), the post-bump CI loop (re-run functional tests, refresh golden values, mark broken tests), and the gotchas that bit PRs",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[938,941],{"name":939,"slug":940,"type":15},"CI\u002FCD","ci-cd",{"name":924,"slug":925,"type":15},"2026-07-14T05:25:59.97109",{"slug":944,"name":944,"fn":945,"description":946,"org":947,"tags":948,"stars":929,"repoUrl":930,"updatedAt":954},"mcore-cicd","manage CI\u002FCD pipelines for Megatron-LM","CI\u002FCD reference for Megatron-LM. Covers CI pipeline structure, PR scope labels, triggering internal GitLab CI (which force-pushes the current branch to a pull-request\u002FBRANCH ref — always dry-run and verify the destination first; never run against shared or protected branches), and CI failure investigation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[949,950,951],{"name":939,"slug":940,"type":15},{"name":924,"slug":925,"type":15},{"name":952,"slug":953,"type":15},"GitHub","github","2026-07-27T06:06:12.278222",{"slug":956,"name":956,"fn":957,"description":958,"org":959,"tags":960,"stars":929,"repoUrl":930,"updatedAt":968},"mcore-create-issue","investigate CI failures and create issues","Investigate a failing GitHub Actions run or job and create a GitHub issue for the failure.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[961,964,965],{"name":962,"slug":963,"type":15},"Debugging","debugging",{"name":952,"slug":953,"type":15},{"name":966,"slug":967,"type":15},"Triage","triage","2026-07-14T05:25:57.442089",{"slug":970,"name":970,"fn":971,"description":972,"org":973,"tags":974,"stars":929,"repoUrl":930,"updatedAt":981},"mcore-linting-and-formatting","lint and format Megatron-LM code","Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[975,978],{"name":976,"slug":977,"type":15},"Best Practices","best-practices",{"name":979,"slug":980,"type":15},"Code Analysis","code-analysis","2026-07-14T05:25:56.18433",{"slug":983,"name":983,"fn":984,"description":985,"org":986,"tags":987,"stars":929,"repoUrl":930,"updatedAt":995},"mcore-migrate-gpt-to-hybrid","migrate Megatron-LM models to HybridModel","Migration guide for moving Megatron Core GPTModel checkpoints, model providers, training commands, and layer mappings to HybridModel.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[988,991,994],{"name":989,"slug":990,"type":15},"Machine Learning","machine-learning",{"name":992,"slug":993,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:11.777011",{"slug":997,"name":997,"fn":998,"description":999,"org":1000,"tags":1001,"stars":929,"repoUrl":930,"updatedAt":1008},"mcore-onboard-gb200-1node-tests","onboard functional tests for GB200","Onboard 1-node GitHub MR functional tests for GB200 from existing mr-scoped 2-node tests.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1002,1005],{"name":1003,"slug":1004,"type":15},"QA","qa",{"name":1006,"slug":1007,"type":15},"Testing","testing","2026-07-14T05:25:53.673039",{"slug":1010,"name":1010,"fn":1011,"description":1012,"org":1013,"tags":1014,"stars":929,"repoUrl":930,"updatedAt":1019},"mcore-run-on-slurm","launch distributed training jobs on SLURM","How to launch distributed Megatron-LM training jobs on a SLURM cluster. Covers a minimal sbatch skeleton, environment-variable setup for torch.distributed.run, CUDA_DEVICE_MAX_CONNECTIONS rules across hardware and parallelism modes, container conventions, monitoring, and per-rank failure diagnosis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1015,1016],{"name":924,"slug":925,"type":15},{"name":1017,"slug":1018,"type":15},"Infrastructure","infrastructure","2026-07-14T05:25:49.362534",{"slug":1021,"name":1021,"fn":1022,"description":1023,"org":1024,"tags":1025,"stars":929,"repoUrl":930,"updatedAt":1033},"mcore-split-pr","split pull requests to reduce review load","Split a PR into multiple PRs to reduce the number of required CODEOWNERS reviewer groups.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1026,1029,1030],{"name":1027,"slug":1028,"type":15},"Code Review","code-review",{"name":952,"slug":953,"type":15},{"name":1031,"slug":1032,"type":15},"Pull Requests","pull-requests","2026-07-14T05:26:01.226578",{"slug":1035,"name":1035,"fn":1036,"description":1037,"org":1038,"tags":1039,"stars":929,"repoUrl":930,"updatedAt":1042},"mcore-testing","run and manage Megatron-LM tests","Test system for Megatron-LM. Covers test layout, recipe YAML structure, adding and running unit and functional tests, golden values, marker filters, and CI parity.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1040,1041],{"name":1003,"slug":1004,"type":15},{"name":1006,"slug":1007,"type":15},"2026-07-14T05:25:54.928983",{"slug":1044,"name":1044,"fn":1045,"description":1046,"org":1047,"tags":1048,"stars":929,"repoUrl":930,"updatedAt":1053},"nightly-sync","manage nightly main-to-dev sync workflows","Domain knowledge for the nightly main-to-dev sync workflow. Covers merge strategy, CI architecture, failure investigation, and known issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1049,1052],{"name":1050,"slug":1051,"type":15},"Automation","automation",{"name":939,"slug":940,"type":15},"2026-07-30T05:29:03.275638",496,{"items":1056,"total":1135},[1057,1072,1083,1090,1103,1114,1124],{"slug":1058,"name":1058,"fn":1059,"description":1060,"org":1061,"tags":1062,"stars":23,"repoUrl":24,"updatedAt":1071},"udf-benchmark","benchmark Spark UDF performance on GPU","Assists with benchmarking and profiling the performance of an Apache Spark UDF on the GPU. This is step 3 of 3 in the UDF conversion workflow (udf-gen-test -> udf-convert-to-* -> udf-benchmark). Use this skill when you have a CPU UDF and a RapidsUDF or SQL implementation, and need to benchmark the performance of the CPU UDF against the GPU implementation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1063,1066,1067,1070],{"name":1064,"slug":1065,"type":15},"Benchmarking","benchmarking",{"name":9,"slug":8,"type":15},{"name":1068,"slug":1069,"type":15},"Performance","performance",{"name":21,"slug":22,"type":15},"2026-07-14T05:30:56.546112",{"slug":1073,"name":1073,"fn":1074,"description":1075,"org":1076,"tags":1077,"stars":23,"repoUrl":24,"updatedAt":1082},"udf-convert-to-cuda","convert Spark UDFs to CUDA RapidsUDFs","Assists with converting a non-aggregating Apache Spark UDF to a native CUDA RapidsUDF using JNI and libcudf. This is step 2 of 3 in the UDF conversion workflow (udf-gen-test -> udf-convert-to-cuda -> udf-benchmark). Use this skill when you have a CPU UDF with a unit test and need to convert it to a native CUDA implementation. Prefer udf-convert-to-cudf unless a CUDA implementation is necessary for performance or correctness, or if requested by the user.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1078,1079,1080,1081],{"name":18,"slug":19,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"2026-07-14T05:30:51.534401",{"slug":4,"name":4,"fn":5,"description":6,"org":1084,"tags":1085,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1086,1087,1088,1089],{"name":18,"slug":19,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"slug":1091,"name":1091,"fn":1092,"description":1093,"org":1094,"tags":1095,"stars":23,"repoUrl":24,"updatedAt":1102},"udf-convert-to-sql","convert Spark UDFs to SQL expressions","Assists with converting an Apache Spark UDF to a functionally equivalent Spark SQL expression. This is step 2 of 3 in the UDF conversion workflow (udf-gen-test -> udf-convert-to-sql -> udf-benchmark). Use this skill when you have a CPU UDF with a unit test and need to convert it to SQL for GPU acceleration.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1096,1097,1098,1099],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":1100,"slug":1101,"type":15},"SQL","sql","2026-07-14T05:30:57.785224",{"slug":1104,"name":1104,"fn":1105,"description":1106,"org":1107,"tags":1108,"stars":23,"repoUrl":24,"updatedAt":1113},"udf-gen-test","generate unit tests for Spark UDFs","Assists with generating a unit test for an Apache Spark UDF. This is step 1 of 3 in the UDF conversion workflow (udf-gen-test -> udf-convert-to-* -> udf-benchmark). Use this skill when you have a CPU UDF and need to create a unit test for the UDF before converting it into a GPU-compatible implementation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1109,1110,1111,1112],{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":1006,"slug":1007,"type":15},"2026-07-14T05:30:55.30163",{"slug":769,"name":769,"fn":1115,"description":1116,"org":1117,"tags":1118,"stars":23,"repoUrl":24,"updatedAt":1123},"review UDF tests and GPU implementations","Reviews generated UDF tests and GPU\u002FSQL implementations for robustness, anti-cheating, and GPU execution integrity. Use when the user requests a judge\u002Freview-agent pass, or when manually reviewing a completed conversion.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1119,1120,1121,1122],{"name":1027,"slug":1028,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":1003,"slug":1004,"type":15},"2026-07-14T05:30:59.022808",{"slug":1125,"name":1125,"fn":1126,"description":1127,"org":1128,"tags":1129,"stars":23,"repoUrl":24,"updatedAt":1134},"udf-optimize-cudf","optimize cuDF RapidsUDF performance","Iteratively optimizes a cuDF RapidsUDF implementation for GPU performance. Use after testing and benchmarking with udf-benchmark. Runs a loop of profiling, optimizing, testing, and benchmarking until performance converges or the iteration budget is exhausted.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1130,1131,1132,1133],{"name":1064,"slug":1065,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":1068,"slug":1069,"type":15},"2026-07-14T05:30:52.785634",7]