Skip to content

Migrate use_flash callers to explicit attention backends - #878

Merged
AkshitaB merged 5 commits into
mainfrom
akshitab/use-flash-cleanup
Sep 25, 2026
Merged

AkshitaB merged 5 commits into
mainfrom
akshitab/use-flash-cleanup

Conversation

@AkshitaB

@AkshitaB AkshitaB commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Repository callers still use the deprecated use_flash boolean even though attention supports explicit backend selection. Migrate training scripts, generation/DDP/MoE tests, and attention test parameterization to backend / attn_backend.

Transformer factories now resolve legacy use_flash arguments into canonical backend configs; the nGPT factory also gains attn_backend. A shared resolver preserves existing compatibility behavior: True selects FA2 or rejects a conflicting explicit backend, while False leaves explicit backends and sliding-window automatic selection unchanged. Legacy fused attention continues to ignore the flag. HF conversion clears the legacy flag when overriding the backend.

Deprecated constructor/config inputs remain accepted for existing callers and old checkpoints. Add regression coverage for serialized legacy configs, backend conflicts, sliding-window selection, and all four affected model factories. Update the changelog. Local cleanup notes and parity audit scripts are excluded.

Also remove the unused, commented-out _set_beaker_execution_units() helper and its commented call from the internal experiment setup (33 lines), with a changelog entry.

Stop setting the deprecated, no-effect force_recompute_fp8_weight_in_bwd flag in AOFloat8LinearConfig.recommended() and remove the corresponding test assertion. Retain the config field for old serialized inputs.

Validation

  • Changed test suites: 198 passed, 1,072 skipped, with the network-dependent test_load_olmo3_7b_config deselected. GPU tests were skipped locally.

  • Ruff over src/: passed.

  • Mypy over all 556 source files: passed.

  • Black/isort checks on changed Python files and git diff --check: passed.

  • Beaker helper cleanup: Python AST unchanged; focused Black/isort/Ruff checks passed.

  • Float8 config tests: 1 passed, 1 GPU test skipped.

@CalebOuellette CalebOuellette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Deprecating use_flash makes sense.

I wonder if it would be helpful if olmo-core could pick between flash2,3 or 4 dynamically based on hardware/what is installed. But i that might be a change for a different PR.

@AkshitaB
AkshitaB force-pushed the akshitab/use-flash-cleanup branch from 5be0ce2 to 3a9febe Compare September 25, 2026 04:58
@AkshitaB
AkshitaB merged commit 306d4b3 into main Sep 25, 2026
25 checks passed
@AkshitaB
AkshitaB deleted the akshitab/use-flash-cleanup branch September 25, 2026 14:21
AkshitaB added a commit that referenced this pull request Sep 25, 2026
Retire the model-ladder orchestration API and its entry points. Remove
`olmo_core.model_ladder`, the `olmo_core.internal.ladder` CLI wrapper,
all eleven ladder training scripts (including the standalone Gemma-like
ladder), and the two dependent Slurm launchers. Also remove
`src/scripts/train/private-olmo.py`.

Remove the ladder API docs and toctree entry and update the changelog.
This deletes about 3,800 lines; the remaining internal experiment
framework stays available. No dedicated ladder tests were found, and no
remaining code/docs references to the deleted modules or script paths
were found.

Existing ladder orchestration configs and commands require an earlier
revision. Model and optimizer checkpoint formats are unchanged; there is
no replacement for the retired orchestration API in this PR.

Stacked on #878; base branch is `akshitab/use-flash-cleanup`. Local
cleanup notes and parity audit scripts are excluded.

## Validation

- Config and transformer train-module config tests: 12 passed, including
the distributed CPU case with local socket access.
- Ruff over `src/` and mypy over all 538 remaining source files: passed.
- Remaining Python source parsing, deleted-path/module reference checks,
and `git diff --check`: passed.
- No GPU training runs were performed for this removal.
jason718 added a commit that referenced this pull request Sep 26, 2026
Second merge of main into this sync branch, taking main from 0589a03 to
718d08f.

Conflicts:
- nn/attention/__init__.py: take main's removal of FusedAttention (#873).
  Vision's only changes to it were NotImplementedError guards for
  or_mask/and_mask/position_ids; FusedAttentionV2 subclasses Attention and
  already threads position_ids. Keep vision's Dict import.
- nn/transformer/model.py: activation checkpointing preserves RNG state when
  dropout is active (vision, #828) or EMO routing needs segment IDs (main,
  #872), which also resolves main's "preserve RNG state if dropout is active"
  TODO.
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

This PR has been released in v3.0.0.

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.

2 participants