Skip to content

TinyOpenFold: fix V3 Triton correctness, add torch.compile, validate on ROCm 7.13#171

Open
asitav wants to merge 2 commits into
amd:mainfrom
asitav:tinyopenfold-triton-bug-fix-and-updates
Open

TinyOpenFold: fix V3 Triton correctness, add torch.compile, validate on ROCm 7.13#171
asitav wants to merge 2 commits into
amd:mainfrom
asitav:tinyopenfold-triton-bug-fix-and-updates

Conversation

@asitav

@asitav asitav commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix V3 Triton correctness. The custom LayerNorm kernel had a variance bug and the
    raw kernels bypassed autograd (no gradients flowed). Added autograd.Function wrappers
    with correct backward passes and switched attention to fused SDPA + QKV fusion.
    version3_triton/test_correctness.py now passes 4/4 (LayerNorm numerics, MSA attention,
    full-model forward, gradient flow).
  • Add --enable-torch-compile to V1 and V3 (V2 already had it) as an orthogonal
    optimization axis available across all versions.
  • Document ROCm 7.13 (TheRock nightly: PyTorch 2.11 / Triton 3.6) setup in the README
    and refresh the tutorial's performance tables with numbers measured on MI300X / ROCm 7.13.

Test plan

  • version3_triton/test_correctness.py → 4/4
  • version2_pytorch_fused/tiny_openfold_v2.py --verify-accuracy → pass
  • V1/V2/V3 training, eager and --enable-torch-compile (small + medium)
  • MI300X (gfx942), ROCm 7.13 / PyTorch 2.11 / Triton 3.6

…on ROCm 7.13

- Fix V3 Triton LayerNorm (correct fwd+bwd with autograd wrappers so gradients flow) and use fused SDPA + QKV fusion; test_correctness now passes 4/4
- Add --enable-torch-compile to V1 and V3 as an orthogonal optimization axis (V2 already had it)
- Update README with ROCm 7.13 (TheRock) setup and refresh tutorial performance numbers measured on MI300X / ROCm 7.13
@asitav

asitav commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@gcapodagAMD, @bobrobey please note.

```bash
# ROCm 7.13 requires Python 3.14 from the module system.
# (The module ships libpython3.14.so.1.0, which pyenv/system Python 3.14 lacks.)
module load python/3.14

@gcapodagAMD gcapodagAMD Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@asitav what system did you work on? we do not have a python module on aac6. we do have a rocm/7.13.0 module but it is not a nightly build

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@gcapodagAMD OK, I simply built it from the prepackaged python libs that comes with every release, e.g., https://github.com/ROCm/TheRock/blob/therock-7.13/RELEASES.md . But, I agree I will have to correct the text that it may come as a module also.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Corrected the narrative in the next commit.

@gcapodagAMD gcapodagAMD self-assigned this Jul 21, 2026
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