Open
Conversation
Collaborator
Author
63dff38 to
206fd73
Compare
206fd73 to
8851a4c
Compare
Collaborator
Author
Collaborator
Author
|
请 @Ziminli 初审,@kilinchange 或 @whjthu 终审。 |
Collaborator
|
PR description 里面有很多 PR 的链接,比如:
后面的
看出来了这里是对应 |
Collaborator
Author
此处是刻意为之的,因为感觉这样好看一点。 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
.github/PULL_REQUEST_TEMPLATE.md— GitHub auto-populates this file into the body of every new pull request against this repository.WITH_*flag inCMakeLists.txt), Test Results on Supported Platforms (table + collapsiblepytestdump), Benchmark / Performance Impact, and Notes for Reviewers.CONTRIBUTING.md— Title/Branch/Commits, Scope & Design, General Code Hygiene, C++ (Google style +clang-formatv21 +clang-tidy+ param order +assert-only error handling + kernel naming + blank-line rules +src/base/layout), Python (PEP 8 +ruff check+ruff format --check+ control-flow blank-line rules + PEP 257), Testing (pytest.mark.parametrize,auto_act_and_assert, regression tests), Build/CI/Tooling (pip install .[dev],compile_commands.json,AUTO_DETECT_DEVICES/AUTO_DETECT_BACKENDS, CUDA-like backend mutual exclusion), Documentation, and Security. Each checkbox references the exactCONTRIBUTING.mdclause it enforces so contributors can trace any failed item back to the source rule.Motivation
CONTRIBUTING.mdalready documents the standards contributors are expected to meet, but until now there was no checkpoint at PR-submission time — reviewers had to manually catch issues like missing cross-platform test results, non-Conventional PR titles, un-clang-formatted C++, kernel/launcher in a single file, or a constructor whose initializer list disagreed with member declaration order. This shifts that burden into the contributor's own workflow by turning each rule into an explicit, per-item checkbox they must verify before requesting review.Specific pain points this addresses:
CONTRIBUTING.md§Pull Requests feat(gemm-iluvatar): add Iluvatar GEMM backend support #3 requires building and testing on every supported platform and including the results in the PR — but the format was unspecified. The template introduces a canonical Platforms Affected checklist + a Test Results table keyed to eachWITH_*CMake flag, so reviewers can see coverage at a glance.assertmessages including__FILE__/__LINE__/__func__, kernel-vs-launcher file separation, PEP 257 docstrings, control-flow blank-line rules) are now surfaced as explicit checks rather than folded into a generic "follow the style guide" instruction.clang-formatv21,ruff check+ruff format --check), so contributors can reproduce CI's pass/fail locally before pushing.No linked issue — this was requested directly. Non-breaking; purely additive governance file, no runtime or build-system impact.
Type of Change
feat— new feature / new operator / new platformfix— bug fixperf— performance improvement (no behavioral change)refactor— code restructuring without behavior changetest— adding or fixing tests onlydocs— documentation onlybuild/ci— build system or CI configurationchore— tooling, formatting, or other non-code changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Test Results on Supported Platforms
pytestResultFull `pytest` output (optional)
Checklist
Title, Branch, and Commits
feat(nvidia): …,fix(cuda/gemm): …).<type>/xxx-yyyy-zzzzwhere<type>matches the PR title's Conventional Commits type and words are joined with hyphens (seeCONTRIBUTING.md§Branches).CONTRIBUTING.md§Pull Requests feat: support GEMM on CPU & MetaX and add generic dispatcher #1).master— the branch is rebased cleanly on top of the currentmaster.fixup!/squash!/wipcommits remain.Scope and Design
CONTRIBUTING.md§Code/General feat: support GEMM on CPU & MetaX and add generic dispatcher #1).printf/std::cout/print(...)left behind, orTODOwithout an owner and issue link.General Code Hygiene (applies to all languages)
CONTRIBUTING.md§Code/General build: add CMake build system and README #2).CONTRIBUTING.md§Code/General feat(gemm-iluvatar): add Iluvatar GEMM backend support #3).the `seqlens_k` tensor) (CONTRIBUTING.md§Code/General feat: add the implementation ofAddoperator on CPU, NVIDIA, and MetaX #4).CONTRIBUTING.md§Code/General refactor: adapt dispatcher for full C++17 compatibility and supportpip installon MetaX #5).CONTRIBUTING.md§Code/General feat(ops): addRmsNormwith Iluvatar, NVIDIA, CPU backends and fp16/bf16 support #6; Python build: add CMake build system and README #2).C++ Specific (if C++ files changed)
clang-format(version 21, per.github/workflows/clang-format.yml) has been run against all modified.h,.cc,.cuh, and.mlufiles; the diff is clean.clang-tidyconcerns (per.clang-tidy) have been reviewed — no new warnings beyond the existing baseline.CONTRIBUTING.md§C++ build: add CMake build system and README #2).assertwith messages that include at least__FILE__,__LINE__, and__func__(CONTRIBUTING.md§C++ feat(gemm-iluvatar): add Iluvatar GEMM backend support #3).CONTRIBUTING.md§C++ feat: add the implementation ofAddoperator on CPU, NVIDIA, and MetaX #4).kernel/kernel_v2/ …; well-known algorithms use the algorithm name; library-based implementations use the library name (CONTRIBUTING.md§C++ refactor: adapt dispatcher for full C++17 compatibility and supportpip installon MetaX #5)..h, kernel follows platform conventions (e.g..cuh+.cu) even when non-templated (CONTRIBUTING.md§C++ feat(ops): addRmsNormwith Iluvatar, NVIDIA, CPU backends and fp16/bf16 support #6).CONTRIBUTING.md§C++ feat: add the implementation ofGemmoperator on Cambricon #7).CONTRIBUTING.md§C++ feat(ops): add Iluvatar GPU backend forAdd#8).CONTRIBUTING.md§C++ feat/devcausalsoftmaxcudaDraft#9).CONTRIBUTING.md§C++ feat: addswigluop with NVIDIA and CPU backends #10).src/base/<op>.h(inheritingOperator<Op>) with platform implementations undersrc/<category>/<platform>/inheriting the base (CONTRIBUTING.md§Adding an Operator feat: support GEMM on CPU & MetaX and add generic dispatcher #1–2).new/delete; RAII / smart pointers / existing allocators are used.Python Specific (if Python files changed)
ruff checkpasses cleanly on CI (see.github/workflows/ruff.yml).ruff format --checkpasses cleanly — if not, runruff formatand commit the result.CONTRIBUTING.md§Python feat: support GEMM on CPU & MetaX and add generic dispatcher #1).pytest.skipmessages without terminal period) are honored where applicable (CONTRIBUTING.md§Python build: add CMake build system and README #2).CONTRIBUTING.md§Python feat(gemm-iluvatar): add Iluvatar GEMM backend support #3).if,for, and similar control-flow statements (CONTRIBUTING.md§Python feat: add the implementation ofAddoperator on CPU, NVIDIA, and MetaX #4).return, except when it directly follows a control-flow statement (CONTRIBUTING.md§Python refactor: adapt dispatcher for full C++17 compatibility and supportpip installon MetaX #5).CONTRIBUTING.md§Python feat(ops): addRmsNormwith Iluvatar, NVIDIA, CPU backends and fp16/bf16 support #6).Testing
pytestwas run locally on every supported platform that this PR can affect, and the results are recorded in the "Test Results" table above (CONTRIBUTING.md§Pull Requests feat(gemm-iluvatar): add Iluvatar GEMM backend support #3).tests/followingtests/test_add.py/tests/test_gemm.pypatterns (CONTRIBUTING.md§Adding an Operator feat(gemm-iluvatar): add Iluvatar GEMM backend support #3).pytest.mark.parametrizecorrectly: dependent parameters share one decorator (e.g.@pytest.mark.parametrize("dtype, rtol, atol", …)), independent parameters use separate decorators ordered by parameter declaration.pytest.mark.auto_act_and_assertis used and the test returns aPayloadwhosefuncandrefshare the same calling convention.dtype/deviceparameterization is relied on, or overridden with an explicitpytest.mark.parametrizewhen necessary.pytest -n 1.masterand passes with this PR.Build, CI, and Tooling
pip install .[dev]on at least one affected platform.compile_commands.jsonstill regenerates (CMake optionCMAKE_EXPORT_COMPILE_COMMANDS=ONinpyproject.toml— required by thecode-lintskill andclang-tidy -p).CMakeLists.txtunderif(AUTO_DETECT_DEVICES)and toif(AUTO_DETECT_BACKENDS)if applicable.CMakeLists.txtis not broken.clang-format.yml,ruff.yml) are green locally (or expected to be green on CI).pyproject.toml's[project.optional-dependencies](or justified in the PR description).Documentation
README.md,CONTRIBUTING.md, or inline docs updated when behavior, build flags, or developer workflow changed.CONTRIBUTING.md§Some Code Explanations).!orBREAKING CHANGE:footer.Security and Safety