Skip to content

[KMCompiler]feat(conj_physical): add hygon runtime and ascend tune config - #5434

Open
tspyc072 wants to merge 1 commit into
flagos-ai:masterfrom
tspyc072:feat/conj-physical-clean
Open

[KMCompiler]feat(conj_physical): add hygon runtime and ascend tune config#5434
tspyc072 wants to merge 1 commit into
flagos-ai:masterfrom
tspyc072:feat/conj-physical-clean

Conversation

@tspyc072

Copy link
Copy Markdown

Summary

This PR optimizes conj_physical operator performance on Hygon BW1000 and Ascend 910B, while verifying that the generic implementation already achieves satisfactory performance on Iluvatar, Metax, and Thead platforms.

Changes

Hygon BW1000

  • Add platform-specific conj_physical runtime override with fixed BLOCK_SIZE=256
  • Add tuned configs in tune_configs.yaml

Ascend 910B

  • Add conj_physical tuned configs in tune_configs.yaml
  • Generic implementation is used (no runtime override needed)

Iluvatar / Metax / Thead

  • Verified that generic implementation performance is on par with torch
  • No platform-specific runtime override needed

Benchmark Results

Iluvatar (generic implementation)

Shape torch.float16 torch.float32 torch.bfloat16 torch.int16 torch.int32 torch.complex64
[256] 1.016 1.000 1.000 1.000 1.000 1.039
[2048, 2048] 1.000 1.021 1.000 1.021 1.021 1.191
[128, 512, 256] 1.000 0.980 1.000 1.000 1.000 1.210
[32, 64] 1.000 1.000 0.980 1.000 1.000 1.533
[512, 1024] 1.000 0.980 1.000 1.000 0.980 1.093
[2, 3, 4] 0.980 1.000 1.000 1.000 0.980 1.028

Thead (generic implementation)

Shape torch.float16 torch.float32 torch.bfloat16 torch.int16 torch.int32 torch.complex64
[256] 1.000 1.000 1.000 1.000 1.000 1.675
[2048, 2048] 1.000 1.000 1.000 1.000 1.000 1.017
[128, 512, 256] 1.000 1.000 1.000 1.000 1.000 1.001
[32, 64] 1.000 1.000 1.000 1.000 1.000 1.217
[512, 1024] 1.000 1.000 1.000 1.000 1.000 1.091
[2, 3, 4] 1.000 1.000 1.000 1.000 1.000 1.700

Hygon BW1000 (with runtime override)

Shape torch.float16 torch.float32 torch.bfloat16 torch.int16 torch.int32 torch.complex64
[256] 1.000 1.000 1.000 0.849 1.200 0.984
[2048, 2048] 1.000 1.000 1.000 1.000 0.833 0.931
[128, 512, 256] 1.000 0.843 0.980 1.019 1.200 0.947
[32, 64] 1.020 1.000 1.000 0.981 1.000 0.984
[512, 1024] 0.843 1.000 1.000 1.178 0.981 1.023
[2, 3, 4] 1.000 1.000 0.981 1.000 1.000 0.944

Metax (generic implementation)

Shape torch.float16 torch.float32 torch.bfloat16 torch.int16 torch.int32 torch.complex64
[256] 1.000 0.974 1.000 1.049 1.044 1.058
[2048, 2048] 1.026 1.026 1.023 0.925 0.976 1.034
[128, 512, 256] 1.000 1.022 1.027 1.024 1.027 0.991
[32, 64] 1.000 0.953 1.054 1.028 1.000 1.115
[512, 1024] 0.974 1.054 0.974 1.000 0.864 0.951
[2, 3, 4] 1.027 1.000 1.000 0.848 1.098 1.038

Tests

  • benchmark/test_conj_physical.py passed on all tested platforms
  • Pre-commit checks passed

Notes

Platform Strategy
Iluvatar Generic implementation
Thead Generic implementation
Metax Generic implementation
Hygon Runtime override + tune config
Ascend Tune config only (generic implementation)

- Hygon BW1000: add runtime override with fixed BLOCK_SIZE=256
- Ascend 910B: add tuned configs for conj_physical
- Benchmark verified on all platforms
@tspyc072
tspyc072 force-pushed the feat/conj-physical-clean branch from 47256a6 to 2929d69 Compare August 13, 2026 04:44
@tspyc072 tspyc072 closed this Aug 13, 2026
@tspyc072 tspyc072 reopened this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant