Skip to content

[Fix] [Test] Remove unused GeLU/SquaredReLU NPU kernels and add Ascend UB Manager tests - #1006

Merged
zhiyuan1i merged 1 commit into
fla-org:mainfrom
sunyi0505:activation
Jul 6, 2026
Merged

zhiyuan1i merged 1 commit into
fla-org:mainfrom
sunyi0505:activation

Conversation

@sunyi0505

Copy link
Copy Markdown
Contributor

Summary

  • torch.compile is natively supported in torch_npu==2.7.1.post4. Remove unused triton-ascend GeLU and SquaredReLU NPU kernels (gelu_fwd/bwd, sqrelu_fwd/bwd), including Triton JIT kernels, Python wrappers, and TritonAscendBackend dispatch methods.
  • Drop @dispatch('modules') from gelu_fwd, gelu_bwd, sqrelu_fwd, and sqrelu_bwd in fla/modules/activations.py; these ops now use the @torch.compile default path on all devices, including NPU.
  • Add tests/utils/test_ascend_ub_manager.py with unit tests and NPU integration tests for ascend_ub_manager (UB capacity detection, tiling strategy, block-size helpers, grid-axis chunking).

Motivation

GeLU/SquaredReLU NPU kernels are not used in practice and add maintenance overhead. UB manager logic from #1001 lacked test coverage.

@sunyi0505

Copy link
Copy Markdown
Contributor Author

This PR is ready. Could you please review it? @zhiyuan1i

@zhiyuan1i
zhiyuan1i merged commit 6bd9069 into fla-org:main Jul 6, 2026
13 of 15 checks passed
@zheliuyu

zheliuyu commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Thanks @ChengQianqian for reporting this issue.

@sunyi0505
sunyi0505 deleted the activation branch July 31, 2026 07:07
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.

3 participants