This repository was archived by the owner on Jul 20, 2026. It is now read-only.
[repo] bump buddy-compiler to the latest version#6
Merged
Conversation
…ligned lowering. (buddy-compiler#724) * [IME] Add FP16 matmul support for Linalg->IME and unify aligned/non-aligned lowering. * trigger CI
…he management, and BPE decoding fix (buddy-compiler#727)
sched.h api are not avaliable in macOS
1. ccache is not enabled, `brew install ccache` failed on our local machine macOS 12.6 2. use python=3.12 in macos, because - py314 doesn't support pytorch 2.10.0 - py313 doesn't support sentencepiece
…#748) * [example] Add Gemma4-E2B end-to-end inference example Add a new end-to-end example for the google/gemma-4-E2B-it model with hybrid attention (sliding window + full attention) and shared KV cache. New files: - examples/BuddyGemma4/: AOT import script, C++ inference driver, CMakeLists, vocabulary, and a post-import MLIR patch for fixing constant-folded cumulative_length in the decode subgraph. Modified files: - TextContainer.h: add tokenizeGemma4() and setTokenCnt() for Gemma4 SentencePiece tokenization with chat template support. - func.py: fix scalar param extraction to produce rank-0 memref instead of memref<1xf32>, resolving type mismatch with subgraph declarations. - examples/CMakeLists.txt: register BuddyGemma4 subdirectory. * [example] Add Gemma4-E2B end-to-end inference example Add a new end-to-end example for the google/gemma-4-E2B-it model with hybrid attention (sliding window + full attention) and shared KV cache. New files: - examples/BuddyGemma4/: AOT import script, C++ inference driver, CMakeLists, vocabulary, and a post-import MLIR patch for fixing constant-folded cumulative_length in the decode subgraph. Modified files: - TextContainer.h: add tokenizeGemma4() and setTokenCnt() for Gemma4 SentencePiece tokenization with chat template support. - func.py: fix scalar param extraction to produce rank-0 memref instead of memref<1xf32>, resolving type mismatch with subgraph declarations. - examples/CMakeLists.txt: register BuddyGemma4 subdirectory. * Add a new end-to-end example for the google/gemma-4-E2B-it model with hybrid attention (sliding window + full attention) and shared KV cache. New files: examples/BuddyGemma4/: AOT import script, C++ inference driver, CMakeLists, vocabulary, and a post-import MLIR patch for fixing constant-folded cumulative_length in the decode subgraph. Modified files: TextContainer.h: add tokenizeGemma4() and setTokenCnt() for Gemma4 SentencePiece tokenization with chat template support. func.py: fix scalar param extraction to produce rank-0 memref instead of memref<1xf32>, resolving type mismatch with subgraph declarations. examples/CMakeLists.txt: register BuddyGemma4 subdirectory. Made-with: Cursor * Add a new end-to-end example for the google/gemma-4-E2B-it model with hybrid attention (sliding window + full attention) and shared KV cache. New files: examples/BuddyGemma4/: AOT import script, C++ inference driver, CMakeLists, vocabulary, and a post-import MLIR patch for fixing constant-folded cumulative_length in the decode subgraph. Modified files: TextContainer.h: add tokenizeGemma4() and setTokenCnt() for Gemma4 SentencePiece tokenization with chat template support. func.py: fix scalar param extraction to produce rank-0 memref instead of memref<1xf32>, resolving type mismatch with subgraph declarations. examples/CMakeLists.txt: register BuddyGemma4 subdirectory. * Add a new end-to-end example for the google/gemma-4-E2B-it model with hybrid attention (sliding window + full attention) and shared KV cache. New files: examples/BuddyGemma4/: AOT import script, C++ inference driver, CMakeLists, vocabulary, and a post-import MLIR patch for fixing constant-folded cumulative_length in the decode subgraph. Modified files: TextContainer.h: add tokenizeGemma4() and setTokenCnt() for Gemma4 SentencePiece tokenization with chat template support. func.py: fix scalar param extraction to produce rank-0 memref instead of memref<1xf32>, resolving type mismatch with subgraph declarations. examples/CMakeLists.txt: register BuddyGemma4 subdirectory. * Add a new end-to-end example for the google/gemma-4-E2B-it model with hybrid attention (sliding window + full attention) and shared KV cache. New files: examples/BuddyGemma4/: AOT import script, C++ inference driver, CMakeLists, vocabulary, and a post-import MLIR patch for fixing constant-folded cumulative_length in the decode subgraph. Modified files: TextContainer.h: add tokenizeGemma4() and setTokenCnt() for Gemma4 SentencePiece tokenization with chat template support. func.py: fix scalar param extraction to produce rank-0 memref instead of memref<1xf32>, resolving type mismatch with subgraph declarations. examples/CMakeLists.txt: register BuddyGemma4 subdirectory.
This commit advances the Triton-to-VIR lowering pipeline by addressing two gaps:
(1) end-to-end support from linalg to VIR (LinalgToVIRPass.cpp), and
(2) end-to-end support from VIR to vector (VIRToVectorPass.cpp).
It now supports linalg.matmul on the main path, supports linalg.reduce through scalar fallback, and enhances the corresponding VIR->vector lowering. Details are listed as follows.
Part 1: LinalgToVIR updates (LinalgToVIRPass.cpp)
- Expanded linalg.generic coverage, including broader arith/math ops (i.e., `arith.constant/add/sub/mul/div/rem/cmp/select/bitwise/shift/minmax/maxnum` and `math.exp`).
- Added `linalg.matmul` lowering and vectorization with broadcast.
- Added linalg.reduce lowering via scalar fallback.
- Strengthened fallback index-only generic and simple cast generic via scalar fallback.
- Improved lowering robustness with yield/store handling.
- In short, linalg2vir-report-summary.md now reflects a larger supported set of
linalg ops/shapes and their corresponding lowering functions.
Part 2: VIRToVector updates (VIRToVectorPass.cpp)
- Enhanced mixed-dialect lowering inside vir.set_vl.
- Added vir.select op and lowering.
- Improved vir.load/vir.store index semantics (including empty-index conventions) to
match LinalgToVIR-generated IR.
- Improved recursive affine.for lowering and vector/tail-scalar coherence.
Part 3: New/updated test coverage
- Added structural lowering tests for linalg->VIR patterns (set_vl/load/store/
broadcast and related forms).
- Added fallback tests for reduce (addf/maxnumf), index-only generic, and cast generic.
- Added runtime-validated linalg->VIR->vector tests for elementwise families
(1D/2D, i32/f32, scalar broadcast, mask/select).
- Added runtime-validated generic-family tests (arith chains, bitwise/shift, cmp/select,
min/max, math.exp).
- Added runtime-validated matmul-family tests (basic / accumulate / tail).
The VIR-related conversion tests now live under tests/Conversion/LinalgToVIR so the coverage is easier to find and maintain as one surface; Apply clang-format for core cpp files.
- Refactored build-mlir into a reusable step. Now TestBuild.yml is just a wrapper around ci-common/action.yml. - Added a new CI workflow test-example.yml that attempts to compile and run all the examples. - The tests themselves are built on ctest, where each test case asserts the result of command execution. - test-example is not triggered automatically because it takes a long time and requires downloading models. However, GitHub does not provide a convenient manual trigger method. So the approach taken here is: allow users with appropriate permissions to trigger the workflow by commenting /run-example in a PR. Also, due to GitHub's limitations, this workflow must be merged into main before it can be triggered. Therefore, we must merge first before we can test.
…mension (buddy-compiler#751) * [VIR] Force the last dimension of VIR to be generated as a dynamic dimension, and change the lowering target for non-unit-stride vir.vec * [VIR] Fix test_gather_scatter bug * [VIR] Add temporary support for linalg.map * [VIR] Add support for arith.maxnumf/minnumf * [VIR] Format code
…deployment for DeepSeek (buddy-compiler#690)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.