Skip to content

【训练营】AI编译器 1.算子添加✅feat(operators): add 8 operators 2.功能开发❌ @simon_chou#22

Open
Simon-CHOU wants to merge 2 commits intobitzyz:mainfrom
Simon-CHOU:simon_chou_20260316
Open

【训练营】AI编译器 1.算子添加✅feat(operators): add 8 operators 2.功能开发❌ @simon_chou#22
Simon-CHOU wants to merge 2 commits intobitzyz:mainfrom
Simon-CHOU:simon_chou_20260316

Conversation

@Simon-CHOU
Copy link
Copy Markdown

PR Description

Summary

This PR adds complete full-stack implementations for 8 operators, achieving the "Grand Slam" target for the AI Compiler Winter Camp 2025 project.

Operators Added

Operator Description Files
Clip Tensor clipping operation operators/Clip.cc, kernels/Clip.cc
Conv 2D convolution operators/Conv.cc, kernels/Conv.cc
LayerNorm Layer normalization operators/LayerNorm.cc, kernels/LayerNorm.cc
LpNorm Lp normalization operators/LpNorm.cc, kernels/LpNorm.cc
RMSNorm Root mean square normalization operators/RMSNorm.cc, kernels/RMSNorm.cc
Softmax Softmax operation operators/Softmax.cc, kernels/Softmax.cc
LogSoftmax Log softmax operation operators/Softmax.cc, kernels/Softmax.cc
UnaryOps Relu, Sigmoid, Tanh, Gelu, Silu operators/Unary.cc, kernels/Unary.cc

Implementation Details

  • Operator Layer: Shape inference, dtype inference, and OpDesc creation
  • Kernel Layer: InfiniCore integration with CPU fallback for robustness
  • Frontend: PyTorch FX converters for seamless integration
  • Tests: Comprehensive C++ unit tests and Python integration tests

Test Results by Platform

Platform C++ Tests Python Tests Status
NVIDIA (CUDA) 15/15 (100%) 37/37 (100%) Passed
MOORE - - ❌ Failed
METAX - - ❌ Failed
ILUVATAR - - ❌ Failed

Note: Failures on MOORE/METAX/ILUVATAR platforms are due to missing operator support in their respective InfiniCore backends.

Known Limitations

  • Functional Development: Not implemented in this PR
  • MOORE Platform: Silu and LpNorm operators not supported by backend
  • test_elementwise_kernel: Disabled due to CUDA Error 304 (environment issue, pre-existing in main)

Files Changed

59 files changed, 4082 insertions(+), 26 deletions(-)

Checklist

  • Code follows project style guidelines
  • C++ unit tests added and passing (NVIDIA)
  • Python integration tests added and passing (NVIDIA)
  • Documentation updated (problems.log.md, reports)
  • Conventional Commits followed

AIcompiler-operators-test-NV-passed

Moore-ScreenShot Fail 2026-03-17 052522

This commit adds complete full-stack implementations for:
- Clip: tensor clipping operation
- Conv: 2D convolution with InfiniCore kernel
- LayerNorm: layer normalization with workspace support
- LpNorm: Lp normalization with CPU fallback
- RMSNorm: root mean square normalization
- Softmax/LogSoftmax: softmax operations with transpose support
- UnaryOps: Relu, Sigmoid, Tanh, Gelu, Silu

Changes:
- Add operator definitions (OperatorObj subclasses)
- Add kernel implementations with InfiniCore integration
- Add PyTorch FX frontend converters
- Add comprehensive C++ and Python tests
- Add CPU fallbacks for robustness
- Add MOORE platform compatibility fixes

Test Results:
- C++ Unit Tests: 15/15 passed (100%)
- Python Frontend Tests: 37/37 passed (100%)

Related Issue: #grand-slam-target
Formatted Python files according to project style guidelines.
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