Skip to content

feat(compile): expose joint backend and bucket settings - #15

Open
yu-chen-code wants to merge 2 commits into
masterfrom
feat-graph-backend-config
Open

yu-chen-code wants to merge 2 commits into
masterfrom
feat-graph-backend-config

Conversation

@yu-chen-code

@yu-chen-code yu-chen-code commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

What type of PR is this?
/kind feature

What does this PR do / why do we need it:

Refreshed on 2026-11-09 against fork/upstream master a6be99d3. PR1421 is now merged upstream, so its duplicate prerequisite has been removed. Current head: 11a9f2f9ca53d0706b06648ff2b02149696c8131; retained feature/dependency commits: d7d0c09e, 11a9f2f9. Git range-diff confirms unchanged feature patches. Focused CPU regression on this exact head: 197 JUnit records, 2 failures, 0 errors. The two existing CPU Inductor strict-equality failures remain recorded. The isolated refresh environments now include master-required PEFT 0.21.2 and accelerate 1.13.0; pip check passes. All numerical runs and older source hashes below are pre-refresh evidence. NPU precision training and formal upstream CI were not rerun for this rebase.

Let TextTrainer's joint-graph configuration select the existing terminal Inductor and FSDP bucketing passes explicitly, and keep backend input metadata consistent with physical parameter storage.

  • Add joint-specific inductor_mode / inductor_configs and fsdp_bucketing / fsdp_bucket_modules fields to CompileConfig, validate them and project them into PassConfig. Defaults retain FX execution and disabled bucketing. Existing decoder backend / mode / options keep their separate meaning.
  • Publish physically sharded placeholder shapes after FSDP and refresh the terminal backend's state-example prefix. Fake propagation must start from actual local storage rather than all-gathering an already-full logical parameter again.
  • Retain Inductor's returned wrapper and report the actual executable backend. An unavailable requested Inductor backend raises rather than being reported as compiled. Existing backend CodeGen refresh boundaries are retained.
  • Reuse the existing Inductor, bucketing, prefetch and gradient-overlap passes. No new Trainer, automatic overlap scheduler or NPU backend implementation is introduced.

Validation uses deploy32, Python3.12.13, Torch2.15.0.dev20261005+cpu and torch-npu2.15.0:

  • Complete compile/config regression: 380 tests and 325 subtests passed; two strict Inductor equality subtests failed identically on the unchanged prerequisite (0.701689600944519 versus 0.7016897201538086, two FP32 ULPs). The assertions are unchanged and no all-tests-passed result is claimed.
  • Actual CPU FX/full/regional backends each completed ten AdamW updates. Maximum loss-relative error was 1.2494e-7; gradient, parameter and Adam-state relative L2 errors were 0.
  • Actual NPU FX execution completed ten updates. Both native Inductor modes were attempted and failed with LoweringException: no scheduling registered for device npu. This Torch build has no NPU Inductor scheduler. The distinct npu Dynamo registration also warns that it is an eager implementation without torchair; it is not used as backend-compilation evidence. NPU Inductor acceptance remains open.
  • Public-CI Pylint configurations have no new finding in the modified scope. Raw runs retain existing warnings in KeywordModel and the unchanged BoxedCodeGen test constant. No filter, suppression, skip or numerical threshold was added.
  • Committed-source hashes, actual editable imports and pip check were verified. Real four-rank EP/GMM completed ten updates with projected bucketing, prefetch and gradient overlap. An AG bucket reduced collective count from 7 to 6; prefetch moved 2 forward/2 backward launches and sank 5 waits; gradient overlap advanced one launch and one wait chain. This case had no eligible RS bucket, so RS fusion is not claimed. These are functional pass receipts, not performance measurements.

Reproduction:

python -m pytest -q tests/ut/compile \
  tests/ut/auto_models/test_build_options.py tests/ut/auto_models/test_public_api.py
python -m pip check

Source manifests, raw failures, unchanged-baseline comparisons and numerical receipts are retained under T020 runs/20261106-graph-capability-spikes. Full DSV4.1 lowering and performance gains are not claimed.

Which issue(s) this PR fixes:

None.

Code review checklist [illustration]:

  • whether to verify the function's return value (It is forbidden to use void to mask the return values of security functions and self-developed functions. C++ STL functions can be masked if there is no problem)
  • Whether to comply with SOLID principle / Demeter's law
  • Whether there is UT test case && the test case is a valid (if there is no test case, please explain the reason)
  • Whether the API change is involved
  • Whether official document modification is involved

@yu-chen-code
yu-chen-code force-pushed the feat-graph-backend-config branch from 81212ce to 11a9f2f Compare November 9, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant