Commit 1d2d58c
Support Helion RoPE override for ComplexRoPE (#3767)
This PR adds a HelionComplexRoPE override targeting exact
ComplexRoPE.Config, enabling DeepSeek V3 through the existing
`--override.imports torchtitan.overrides.helion_rope` path.
While Helion doesn't support complex tensors, it instead produces the
cos and sin output separately and puts them together as a complex tensor
in torch. Similar to cos_sin rope, we also add an integration test for
deepseek v3.
We benchmark on 2xGB200:
- DeepSeek V3 debugmodel, fwd_bwd only
- DP shard=2, EP=2, TP=1, CP=1, PP=1, full_dtensor
- local batch size 4, global batch size 8
- warmup=5, iters=20
- model compile off
- FlexAttention compile on
- fwd_bwd (in ms)
- we compared loss and gradient l2 norms to confirm accuracy.
| seq_len | baseline | with Helion ComplexRoPE | speedup |
|---:|---:|---:|---:|
| 2048 | 563.246 ms | 511.982 ms | 1.100x |
| 4096 | 570.322 ms | 526.500 ms | 1.083x |
| 8192 | 572.380 ms | 542.133 ms | 1.056x |
| 16384 | 568.548 ms | 539.765 ms | 1.053x |
| 32768 | 636.378 ms | 625.146 ms | 1.018x |
| 65536 |1107.151 ms | 1090.194 ms | 1.016x |
Co-authored-by: Ethan Che <eche@meta.com>1 parent 7cdf0aa commit 1d2d58c
3 files changed
Lines changed: 852 additions & 99 deletions
File tree
- tests
- integration_tests
- unit_tests
- torchtitan/overrides
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
0 commit comments