Repository navigation
Conversation
|
/bot run |
|
PR_Github #81844 [ run ] triggered by Bot. Commit: |
|
PR_Github #81844 [ run ] completed with state
|
|
Relaxing the naming and layout rules makes sense to me. The structure checks I suggest below don't have to be pre-merge blockers either. They could run post-merge or be triggered manually, and report problems instead of failing PRs. That would still help us keep the Modeling V2 code structure in line with the design over time. Still, I think we need some tests that make it easy to check that the modeling code and its tests stay aligned. For example:
The deleted |
5a9c52d to
f98d07d
Compare
CBTS selects Modeling V2 tests by the scope of a change: a target change runs that target's tests, family and catalog code run the targets and unit tests that import it, and shared code runs everything. Accuracy tests move to one directory per target, l0_b300 gets one entry per target, and test_modeling_v2_ci_selection.py checks the structure that selection relies on. Naming and layout are no longer enforced. Co-authored-by: Tao Li <[email protected]> Signed-off-by: Eric Tsai <[email protected]>
f98d07d to
c232d2a
Compare
Description
Modeling V2 lets each model family and target own its code, so one model can change without affecting others. CI should follow the same scope: a change runs the tests of the code it can affect, and nothing else. This PR does that, and keeps naming and layout as conventions instead of enforced rules.
Test selection follows the scope of the change
The CBTS
ModelingV2Rulenow selects tests by scope:routing.py, native or other non-Python family code_op.py, resolver, loader, native build)ast, once per run. It follows relative imports, package__init__files, test helper modules andimportlibcalls. A computedimportlibcall counts as importing its whole directory. Imports of a deleted or moved module still count, so the targets that used it are tested.models/<family>/is a target whenaccuracy/modeling_v2/<family>/<target>/exists.Test layout mirrors the code
accuracy/modeling_v2/<family>/<target>/test_accuracy.py. Class and test names do not change. Helpers shared by a family's targets move to<family>/_common.py..test_durationsand CODEOWNERS use the new paths.l0_b300replaces its one entry for the wholeunittest/_torch/modeling_v2tree, and its one MiniMax-M3 entry, with one entry per GPU-run top-level file, catalog category and target, as the other stages already have. Without this, every target change still ran the whole tree on B300. The stale waive for the old entry is removed.Naming and layout are no longer enforced
_native.pyfinds a target by its position in the package path, not by__in its name.modeling_v2.cmakeaccepts any Python package name as a target name and uppercase family names. Family torch namespaces join the collision check.test_modeling_v2_claims.pyandtest_modeling_v2_native_claims.pyare deleted. They checked naming and file conventions.Structure checks
Selection by path is safe only while the code and tests keep a few structural rules. If one breaks, a test is silently not selected.
tests/unittest/_torch/modeling_v2/test_modeling_v2_ci_selection.py(CPU) checks them, and CBTS runs it for every Modeling V2 change.routing.pyimports a target, and targets do not import each other.models/andaccuracy/modeling_v2/names an existing family.routecan return has an accuracy test directory.cpu_onlytest sits on a CPU stage. Three known gaps are listed with reasons, and the check fails when a listed gap is fixed, so the list stays current.Other changes
test_modeling_v2_env_scope.pyscans the accuracy tests recursively and fails if it finds none.Known gaps
Test Coverage
tests/unittest/scripts/cbts/test_modeling_v2.pyandtest_modeling_v2_rule.py: one case per selection row, plus transitive, relative and dynamic imports.tests/unittest/_torch/modeling_v2/test_modeling_v2_ci_selection.py,test_modeling_v2_env_scope.py,test_modeling_v2_native_loader.py.agent-flow/tests/workflows/trtllm_modeling_v2.PR Checklist