[PyTorch] Refactor grouped linear and grouped MLP tests#3122
Conversation
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Remove unused imports and helpers left after splitting grouped MLP tests out of the fusible ops suite. Co-authored-by: Codex <codex@openai.com> Signed-off-by: Tim Moon <tmoon@nvidia.com>
for more information, see https://pre-commit.ci
Greptile SummaryThis PR refactors the grouped linear and grouped MLP tests by splitting them across two files:
Confidence Score: 5/5Safe to merge — this is a pure test reorganization with no changes to production code paths. All changed files are tests or CI scripts. The new test_grouped_mlp.py faithfully reproduces the parametrized coverage that was removed from test_fusible_ops.py, and test.sh correctly applies the required environment variables only to the files that need them. No files require special attention beyond the already-flagged quantization list initialization issue in test_grouped_mlp.py (covered in a previous review thread). Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[test.sh] --> B[test_fusible_ops.py\nbasic GroupedLinear smoke tests]
A --> C[test_grouped_mlp.py\nNVTE_GROUPED_LINEAR_SINGLE_PARAM=1\nNVTE_CUTEDSL_FUSED_GROUPED_MLP=1]
A --> D[test_grouped_linear.py\nPYTORCH_JIT=0 NVTE_TORCH_COMPILE=0]
C --> E[TestGroupedLinearOp\ntest_grouped_linear\ntest_grouped_linear_cuda_graph_safe]
C --> F[TestGroupedMLPFusedOp\ntest_grouped_mlp\ntest_grouped_mlp_fp16\ntest_grouped_mlp_mcore_integrations\ntest_grouped_mlp_single_weight_numerics\ntest_grouped_mlp_overwrite_main_grad\ntest_grouped_mlp_cuda_graph_safe_mxfp8]
C --> G[test_grouped_gemm_quant_cute_matches_mxfp8_quantized]
B --> H[TestBasicOps.test_grouped_linear\nsimplified params - no single_grouped_weight/bias]
Reviews (2): Last reviewed commit: "Review suggestion from @greptile-apps" | Re-trigger Greptile |
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
|
/te-ci pytorch |
vthumbe1503
left a comment
There was a problem hiding this comment.
LGTM. I referred to the commit changes as it was easy to read. Testing mcore based main grad changes and fp16 case seperately was good idea to reduce parametrization. Also fixing glu_inertelave_size to 32 in grouped mlp makes sense. Since we are already testing for None in other tests.
Description
test_fusible_ops.pywas becoming a dumping ground for random grouped MLP tests, including tests that didn't involve fusible ops at all. This PR reorganizes the tests so thattest_fusible_ops.pyholds basic tests forte.ops.GroupedLinear, whiletest_grouped_mlp.pyholds the exhaustive tests for all the various grouped MLP fused ops. I've also tried trimming down excessive test parametrization to bring down the test time from ~20 min to ~5 min.#3111 was an earlier attempt at this refactor.
Type of change
Changes
test_fusible_ops.pyintotest_grouped_mlp.pyChecklist: