Repository navigation
Improve AOTI compilation of hstu model - #380
Conversation
geoffreyQiu
commented
May 10, 2026
- Better support for dynamic inference shape with torch export & AOTI compilation
- Add fix for NVE embedding table dynamic shape tracing
- Add training model to inference model conversion
- Add benchmark for AOTI compiled model.
Greptile SummaryThis PR improves
Confidence Score: 4/5Safe to merge for development; the static/dynamic config swap in apply_inference_sparse and per-feature D2H syncs in permute_and_split warrant attention before production deployment. The conversion pipeline is largely correct and collections are wired properly for the forward path. However, apply_inference_sparse passes model_parallel configs as static and data_parallel configs as dynamic — opposite of what the collection assignments imply — leaving stored configs out of sync with their collections. Additionally, permute_and_split issues O(num_features) blocking D2H synchronizations on every inference forward pass. examples/hstu/modules/exportable_embedding.py (apply_inference_sparse arg ordering and return type); examples/commons/ops/cuda_ops/csrc/kjt_aux_op.cpp (per-feature D2H syncs in permute_and_split_impl) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Training Model RankingGR] --> B[apply_inference_embedding_collection]
B --> C[InferenceEmbeddingCollection static + dynamic]
A --> D[apply_inference_sparse]
D --> E[ExportableEmbedding]
A --> F[apply_inference_hstu_dense]
F --> G[InferenceDenseModule HSTUBlock + MLP reused]
E --> H[InferenceRankingGR]
G --> H
H --> I[torch.export + AOTI]
I --> J[model.pt2]
J --> K[Python benchmark]
J --> L[C++ benchmark run_one_round]
Reviews (9): Last reviewed commit: "Apply fix" | Re-trigger Greptile |
This comment was marked as outdated.
This comment was marked as outdated.
733b668 to
147d6ac
Compare
|
/build |
|
❌ Pipeline #51257931 -- failed
Result: 6/14 jobs passed |
- Clearify torch.Tensor inputs for concat_2D_jagged_tensors related functions - Fix input of `List[torch.Tensor]` in test_jagged_tensor.py - Fix import order for `apply_inference_sparse` - Fix minimum batch size for exporting hstu model