Repository navigation
fix(ezpz): sync attn_gym deferral from main (#5565); document 30B infeasible on current frameworks - #76
Conversation
Full (torch_remat 0.2.0 on aurora_frameworks-2026.1.0) hits _set_storage_data_ptr_access_error_msg bomb; none OOMs at 30B even at 8N (9053526 CCL scaleout_device_buf malloc fail). Selective (DefaultActivationRematConfig, model-declared regions) uses a different torch_remat path and may fit within XPU memory. 4B/10B stay on none (already finite-loss).
Branch was 124 commits behind main; attn_gym.py predated 3ed5aa9 which defers backend ImportError from attn_gym.linear._lazy (causal_conv1d via cute.py:26 import cutlass) to a _MissingKernel placeholder. Without it, any import of torchtitan.models.common — including torchtitan.experiments.ezpz.agpt.config_registry via agpt/__init__.py:36 — hard-fails on macOS where attn-gym 0.0.17 is installed but cutlass is absent. Aurora (Intel XPU via aurora_frameworks-2026.1.0 / oneAPI, no CUDA) was never affected — its XPU path does not hit cutlass the same way and all 4B/10B jobs reached Training starts at step 1. Bring file verbatim from origin/main.
Reviewer's GuideAPIExtend the Attention Gym facade to defer missing optional-backend failures while retaining backend-specific errors and placeholders.
Uses of the APIUpdate attention callers to recognize deferred placeholders and require the exports they use when building attention modules.
ImplementationAdd a reproducible manifest builder that selects raw OLMo-mix shards in DP-compatible counts and can shuffle their order.
ConfigurationAdd Grain-based data-mixture and raw OLMo-mix training configurations, restore the debug streaming recipe, and disable the unsupported science-source blend builder.
Revise the FineWeb-Edu CPT launcher for the 60/40 mix, PPN=8 layout, and explicit MDS base path.
Allow callers to override the B2v2 SFT checkpoint directory rather than always writing to the default epoch-based path.
Add per-seat Aurora job submission and preserve the umbrella PBS launch configuration.
DocumentationRecord the MMLU letter-prior findings and explain why MCF MMLU should not gate agpt-2B promotion.
Document the proposed FineWeb-Edu 60/40 corpus shift, its supporting results, and related production SFT guidance.
Record the 2088-node umbrella failure, per-seat resubmission, and updated production status.
TestsCover missing Attention Gym packages, backend imports, lazy exports, mixed backend availability, and attention-module build failures.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="torchtitan/models/common/attn_gym.py" line_range="259" />
<code_context>
-def require_attn_gym() -> None:
- if _load_module("attn_gym") is None:
- _raise_missing()
+def require_attn_gym(kernel: object, *kernels: object) -> None:
+ """Raise unless every given export imported.
+
</code_context>
<issue_to_address>
**GDN and KDA construction fails**
When a model constructs a GDNKernel or KDAKernel, `GDNKernel.__init__` and `KDAKernel.__init__` call `require_attn_gym()` without arguments, so the required `kernel` parameter raises `TypeError` before the backend check runs, and model construction fails.
Pass the required kernel exports to both calls, or make the argument optional while preserving the intended backend check.
Also at `torchtitan/models/common/attn_gym.py:260`.
</issue_to_address>
### Comment 2
<location path="torchtitan/models/common/attn_gym.py" line_range="146" />
<code_context>
raise ModuleNotFoundError(
"Attention Gym kernels require attn_gym. "
- "Install it with: python -m pip install 'attn-gym[linear,cudnn]==0.0.16'.",
+ "Install it with: python -m pip install 'attn-gym[linear,cudnn]==0.0.17'.",
name="attn_gym",
)
</code_context>
<issue_to_address>
**Optional-import tests fail**
When the CPU optional-import tests exercise a missing Attention Gym package, the missing-package error recommends attn-gym 0.0.17, while the tests still assert that it recommends 0.0.16, so the assertions fail and the test suite is blocked.
Update the optional-import test assertions to expect the new 0.0.17 recommendation.
Also at `torchtitan/models/common/attn_gym.py:147`.
</issue_to_address>
### Comment 3
<location path="torchtitan/models/common/attn_gym.py" line_range="182" />
<code_context>
+ if kernel is None:
+ kernel = type(
+ f"_MissingKernel[{key}]",
+ (_MissingKernel,),
+ {"__module__": __name__, "_error": _BACKEND_ERRORS[key]},
+ )
</code_context>
<issue_to_address>
**Missing backend reaches SPMD registration**
When an Attention Gym export is replaced with a backend-missing placeholder, `_missing_backend_kernel()` creates a subclass of `_MissingKernel`, but the attention-module registration guards compare by exact identity, so they pass the placeholder to `register_local_autograd_function` as a real kernel, defeating deferred backend handling and risking SPMD processing failures.
Update the attention-module registration guards to recognize `_MissingKernel` subclasses as missing placeholders rather than real kernels.
Also at `torchtitan/models/common/attn_gym.py:183`.
</issue_to_address>30B 8N selective (9053611, E 143) hits the same _set_storage_data_ptr_access_error_msg bomb as full: _placeholder.py:101 torch._C._set_storage_data_ptr_access_error_msg AttributeError: module torch._C has no attribute ... Both DefaultActivationRematConfig and FullActivationRematConfig go through torch_remat 0.2.0 on aurora_frameworks-2026.1.0 (torch 2.13). 30B stays infeasible until frameworks pins a compatible torch_remat. Keep 30B on none and document the failure; keep attn_gym pytorch#5565 sync.
Add agpt_v2_{4b,10b}_4k_olmo_mix, which stream the raw olmo-mix-1124 JSON
shards listed in $AGPT_V2_DATA_MANIFEST through the Grain HF streaming
source, and build_olmo_mix_manifest.py, which sizes that list to a multiple
of the DP world size so split_dataset_by_node assigns whole files per rank.
…is_missing_kernel in callers Sourcery flagged that only attn_gym.py was synced from main (pytorch#5565); its callers still did bare require_attn_gym()/identity checks that TypeError'd or leaked placeholders into SPMD registration when cutlass/triton absent. Pull the companion 4 files from main and add a compat shim for the renamed prepare_cp_linear_attention_metadata. Co-Authored-By: internal-model
Subagent fanout: FineWeb-Edu 60/40 kind-shift proposal (SmolLM2 33.6% @38B vs current 94.8% DCLM monoculture) + MMLU letter-prior gating appendix (constant-D 0.2689 > all 2B 0.2413-0.2655 is harness prior). 5 files (2 new + 3 updated indexes), no compute. Co-Authored-By: internal-model
12483035 failed: world_size 60 (5xPPN12) 11008%60!=0 FSDP uneven sharding plus missing MDS_ANNEAL_BASE on Sunspot (~/torchtitan has no outputs/, lives on TEGU at .../projects/saforem2/.../step-0). Fix: select=4 PPN=8 -> 32r (11008%32==0), export MDS_ANNEAL_BASE to TEGU path. Adds agpt_2b_mds_mix_owm_edu_6040 (SmolLM2 60/40 FWE/DCLM stage-1). Co-Authored-By: internal-model
8026ad8 to
07fdd23
Compare
HFDataSource/InterleavedHuggingFaceTextDataLoader deleted in pytorch#4088; previous mix builders always crashed. Port to GrainDataLoader (DatasetMix after ConcatThenSplitPacking) so weights count packed 8192-token rows (token-weighted). Adds agpt_2b_mds_mix_owm_edu_6040 (SmolLM2 60/40). CPT script already switched to PPN=8 and MDS_ANNEAL_BASE TEGU path (prior 12483035 failed on both). Co-Authored-By: internal-model
07fdd23 to
e92da5b
Compare
…ered by CPT push)
Placeholder 9053470 (select=2088, 24h) ran 4h26m — a single GPU fatal error (grf_fatal_singlesubslice_error on x4415c5s5b0n0, 10B slice) made PBS kill the whole 2088N job and all four seats. 20B-512 hung after 10854 (watchdog restart, no new ckpt), 20B-256 saved step-21100, 4B saved step-2600, 10B at 768N never trained (step-1 loss 17788+). Resubmitted as one PBS job per seat (seat-autoretry-20261111.pbs + submit-seats-20261111.sh): 10B moved 768N->512N, HF cache on /tmp. Umbrella PBS retained for provenance. Journal + PROD/README updated. Co-Authored-By: internal-model
ufmt on config_registry and cp_linear_attention, license header on build_olmo_mix_manifest, spell out FW-Edu and 'reused' for codespell.
split_dataset_by_node gives rank r files r, r+dp, ..., so a sorted manifest feeds the subsets in path order. The builder now writes a seed-0 shuffle by default. The 10B seat defaults to olmo-mix-dp6144-shuf0.txt; the 4B stays on the sorted file it resumes from.
Port upstream's require_attn_gym calls for ContextParallelInnerKDA and ContextParallelInnerGDN. Without them the four context-parallel cases in test_optional_imports.py (copied from upstream on this branch) built successfully with a missing backend and failed.
…t2b-cpt17000-gsm8k-3ep not default ep3 (avoids clobbering ckpt93 B2)
# Conflicts: # torchtitan/experiments/ezpz/agpt/config_registry.py # torchtitan/experiments/ezpz/docs/production/sft/README.md
30B was OOM at every scale with
activation_checkpoint_mode=none:UR_RESULT_ERROR_OUT_OF_RESOURCES(12482796/830)CCL scaleout_device_buf malloc fail(9053526)Tried gating 30B to
selective(DefaultActivationRematConfig):Aurora 8N selective
9053611E 143 — sametorch_remat0.2.0 bomb asfull:Both
FullActivationRematConfigandDefaultActivationRematConfiggo through
torch_rematonaurora_frameworks-2026.1.0(torch2.13). 30B stays infeasible until frameworks pins a compatible
torch_remat; keepnoneand document.This PR now only lands the
attn_gym.pysync from main (pytorch#5565,3ed5aa9) — defers
cutlassbackend miss to_MissingKernelinsteadof hard-failing
torchtitan.models.commonimport. Branch was 124commits behind main.
4B/10B finite-loss unchanged:
904449413.98,905349014.62,1248279113.24,1248279514.67.Summary by Sourcery
Improve optional Attention Gym compatibility and add data-mixture training paths while documenting current 30B and MMLU evaluation limitations.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: