Repository navigation
[Example] Add sparse mla examples - #896
Conversation
… for deepseek_v32 example
- Removed unused imports and functions from `fp8_mqa_logits.py` to streamline the code. - Improved formatting and readability in `sparse_mla_fwd_pipelined.py` and `sparse_mla_fwd.py` by adjusting function signatures and indentation. - Added `# ruff: noqa` comments to suppress linting warnings in multiple files. - Enhanced the `generate_random_cu_seqlens` function in `utils.py` for better clarity and organization. - Updated print statements for consistency in output formatting.
|
Caution Review failedThe pull request is closed. WalkthroughAdds a README directory structure. Introduces new FP8 MQA logits pipeline with JIT kernels, reference implementation, validation, and benchmarking. Adds two sparse MLA forward kernels (standard and pipelined) with interfaces, references, tests, and profiling. Provides a new utilities module for sequence-length math, FP8 casting, caching, and helpers. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Py as Python Script
participant TL as TileLang Kernel
participant Ref as Reference Impl
participant Utils as Utils
User->>Py: Run fp8_mqa_logits.py (__main__)
Py->>Utils: Generate cu_seqlens / scales
Py->>TL: mqa_attn_return_logits_interface(q_fp8, kv_fp8, ...)
TL-->>Py: logits_tl
Py->>Ref: ref_fp8_mqa_logits(q_fp32, kv_fp32, ...)
Ref-->>Py: logits_ref, cost_ref
Py->>Py: validate_tensor_match(logits_tl, logits_ref)
Py-->>User: Print diff, perf, cost
sequenceDiagram
autonumber
actor User
participant Py as sparse_mla_fwd*_interface
participant TL as TileLang Kernel
participant Ref as PyTorch Ref
participant Prof as Profiler
User->>Py: Call interface(q, kv, indices, ...)
Py->>Py: Validate shapes, compute sm_scale
Py->>TL: Launch kernel (sparse_mla_fwd / pipelined)
TL-->>Py: output, lse
Py->>Ref: Optional reference run
Ref-->>Py: output_ref
Py->>Py: Compare outputs (optional)
Py->>Prof: Benchmark
Prof-->>User: Throughput/metrics
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
* Update README.md to include directory structure and file descriptions for deepseek_v32 example * Refactor and clean up deepseek_v32 example scripts - Removed unused imports and functions from `fp8_mqa_logits.py` to streamline the code. - Improved formatting and readability in `sparse_mla_fwd_pipelined.py` and `sparse_mla_fwd.py` by adjusting function signatures and indentation. - Added `# ruff: noqa` comments to suppress linting warnings in multiple files. - Enhanced the `generate_random_cu_seqlens` function in `utils.py` for better clarity and organization. - Updated print statements for consistency in output formatting.
as title.
Summary by CodeRabbit
New Features
Documentation