Skip to content

[AscendNPU-IR] Support the Engram operator for DeepSeek V4#951

Open
lzp1021 wants to merge 2 commits intotile-ai:npuirfrom
lzp1021:ds-engram
Open

[AscendNPU-IR] Support the Engram operator for DeepSeek V4#951
lzp1021 wants to merge 2 commits intotile-ai:npuirfrom
lzp1021:ds-engram

Conversation

@lzp1021
Copy link
Copy Markdown

@lzp1021 lzp1021 commented Apr 30, 2026

Support the Engram operators for DeepSeek V4

@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the TileLang project.

Please remember to run bash format.sh in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.

We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work!

🚀

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces forward and backward kernels for the engram gate operator implemented using tilelang for NPU targets. The implementation includes reference PyTorch versions and test scripts. Feedback focuses on optimizing the backward kernel by fusing redundant passes to reduce global memory access, removing hardcoded constants like head multipliers and persistent block counts for better flexibility, and moving shared memory allocations outside of loops to improve efficiency.

Comment thread examples/deepseek_v4/engram/engram_gate_kernel_bwd.py
Comment thread examples/deepseek_v4/engram/engram_gate_kernel_bwd.py Outdated
Comment thread examples/deepseek_v4/engram/engram_gate_kernel_bwd.py Outdated
Comment thread examples/deepseek_v4/engram/engram_gate_kernel_fwd.py Outdated
Comment thread examples/deepseek_v4/engram/engram_gate_kernel_fwd.py Outdated
@lzp1021 lzp1021 changed the title Support the Engram operator for DeepSeek V4 [AscendNPU-IR] Support the Engram operator for DeepSeek V4 Apr 30, 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.

1 participant