Skip to content

[graph_trainer] Re-enable DSv3 eager bitwise deterministic tests - #3482

Merged
SherlockNoMad merged 1 commit into
mainfrom
reenable-dsv3-eager-bitwise-tests
Jun 2, 2026
Merged

SherlockNoMad merged 1 commit into
mainfrom
reenable-dsv3-eager-bitwise-tests

Conversation

@SherlockNoMad

Copy link
Copy Markdown
Contributor

Summary

The two DSv3 test_eager_self_deterministic tests (sdpa + FlexAttn) in
test_bitwise_deterministic.py were @unittest.skip-ped in #3432 because their
hardcoded model_hash/grad_hash went stale after upstream PyTorch nightly
changes (notably the MoE expert-counting switch from histc to routing map in
#3450).

This re-enables them:

  • Re-baselined the inline hashes on H100 via EXPECTTEST_ACCEPT=1.
  • Replaced the unconditional @unittest.skip with the
    @unittest.skipUnless(has_cuda_capability(9, 0), ...) gate that the Llama3 /
    Qwen3 siblings already use, since these numerics only match on sm_90+.

Why

These are the eager self-determinism guardrails (run via Trainer, no
make_fx), so the histc/tracing regressions never applied to them — only the
baked-in expected hashes were stale. The loss is unchanged
(7.4749956130981445 for both); only the full-precision model_hash /
grad_hash moved.

Test

On 8×H100 (sm_90):

pytest torchtitan/experiments/graph_trainer/tests/test_bitwise_deterministic.py \
  -k "TestDSv3BitwiseDeterministic and test_eager_self_deterministic or \
      TestDSv3FlexAttnBitwiseDeterministic and test_eager_self_deterministic" -v

Both pass reproducibly against the new baselines (verified without
EXPECTTEST_ACCEPT, i.e. a true guardrail check). pre-commit clean.

Note: the FlexAttention test_precompile_vs_trace skips ("unpicklable code
objects") are intentionally left in place — that is a separate, structural
limitation tracked elsewhere.

The two DSv3 test_eager_self_deterministic tests (sdpa + FlexAttn) were
@unittest.skip-ped in #3432 because their hardcoded model/grad hashes went
stale after upstream PyTorch nightly changes (notably the MoE expert-counting
switch from histc to routing map in #3450).

Re-baseline the inline hashes on H100 via EXPECTTEST_ACCEPT=1 and replace the
unconditional @unittest.skip with the @unittest.skipUnless(has_cuda_capability(
9, 0)) gate the Llama3/Qwen3 siblings already use, since these numerics only
match on sm_90+.

The loss is unchanged (7.4749956130981445 for both); only the full-precision
model_hash and grad_hash moved. Verified the eager run is self-deterministic:
both tests pass reproducibly against the new baselines without EXPECTTEST_ACCEPT.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 2, 2026
@SherlockNoMad
SherlockNoMad merged commit 051562e into main Jun 2, 2026
18 of 20 checks passed
saforem2 added a commit to saforem2/torchtitan that referenced this pull request Jun 2, 2026
…no ezpz replay

Pulled 2 commits from upstream/main (04a3098..27aa490, merge
commit 45a2b25):

- 27aa490 [graph_trainer] Add full recompute memory policy (pytorch#3429)
- 051562e [graph_trainer] Re-enable DSv3 eager bitwise deterministic
  tests (pytorch#3482)

Both entirely inside torchtitan/experiments/graph_trainer/. Zero
ezpz code or doc changes triggered. No conflicts. Tree clean.

Documents both commits in upstream-sync.md and adds a one-paragraph
journal note pointing at the sync entry.
SherlockNoMad added a commit that referenced this pull request Jun 2, 2026
The test_eager_self_deterministic baselines for Llama3 FlexAttention,
Qwen3 MoE, and Qwen3 MoE FlexAttention drifted after upstream PyTorch
nightly numerics changes -- the same class of drift #3432/#3482 handled
for DSv3. This is the pure-eager path (base Trainer, no compile): the
loss strings are unchanged; only model_hash/grad_hash moved in low-order
bits. test_aot_fx_trace_vs_eager still passes, so the trace path stays
bitwise-identical to eager; only the absolute baselines were stale.

All six hashes (three classes) regenerated on H100 against the CI
nightly (cu130).
SherlockNoMad added a commit that referenced this pull request Jun 2, 2026
…oE) (#3484)

## Summary

`test_eager_self_deterministic` baselines for **Llama3 FlexAttention**,
**Qwen3 MoE**, and **Qwen3 MoE FlexAttention** drifted after upstream
PyTorch nightly numerics changes — the same class of drift #3432/#3482
already handled for DSv3. The H100.8 CI was red on these three.

This is the **pure-eager path** (base `Trainer`, no compile/trace):
- Loss strings are **unchanged** → low-order numeric drift, not a real
break.
- `test_aot_fx_trace_vs_eager` still passes → the trace path stays
bitwise-identical to eager; only the absolute `model_hash`/`grad_hash`
baselines were stale.

## How the new hashes were obtained
- **Qwen3 MoE** / **Qwen3 MoE FlexAttn**: regenerated on a local H100
and verified **bitwise-equal to the CI nightly (cu130)** `model_hash`,
so their `grad_hash` is authoritative.
- **Llama3 FlexAttn**: local (CUDA 12.8) diverges from CI (cu130) for
this flex path, so both hashes were taken from the CI run.

## Validation
GraphTrainer 8-GPU H100 CI green on this branch: bitwise suite **21
passed, 3 skipped** (the 3 skips are the pre-existing
FlexAttn-precompile tests). Loss strings untouched.

> Note (separate issue): one earlier run on this branch hit a **flaky**
`qwen3_moe` FSDP+TP+EP all-to-all crash (`RuntimeError: Split sizes
doesn't match total dim 0 size`) — intermittent, unrelated to this
test-only change (the prior main run on #3429 passed that flavor and
failed only on these same stale hashes). Worth a separate look.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants