Repository navigation
Conversation
baominghelly
requested changes
Dec 4, 2026
| namespace infini::ops { | ||
|
|
||
| template <> | ||
| class Operator<Cat, Device::Type::kMetax, 0> : public Cat { |
Collaborator
There was a problem hiding this comment.
cat和take算子是不是可以先加类cuda算子(src/native/cuda/ops),然后metax继承啊?
sum算子在src/native/cuda/ops 下面已经有实现了,看看是不是可以直接继承。
Contributor
Author
There was a problem hiding this comment.
已按这个方向处理:
cat、take新增了通用 CUDA-style 实现,分别在src/native/cuda/ops/cat/kernel.h和src/native/cuda/ops/take/kernel.h,MetaX wrapper 现在直接继承它们。sum原来的src/native/cuda/ops/sum/kernel.cuh只是 NVIDIA kernel 片段,不能直接继承;我补了通用CudaSum和sum_kernel.cuh,MetaX wrapper 也改为继承通用实现。
验证结果:pytest tests/test_cat.py --devices metax 30 passed,另外 sum/take/cat 的最小对比脚本也和 PyTorch 参考一致。
| float dropout_p, float softmax_scale, bool zero_tensors, bool causal, | ||
| int window_size_left, int window_size_right, float softcap, | ||
| bool return_softmax, std::optional<at::Generator> generator, | ||
| std::optional<at::Tensor>& flash_attn_mars_ext, bool return_max_logit); |
Collaborator
There was a problem hiding this comment.
Contributor
Author
There was a problem hiding this comment.
我对照了 #1033 的改动。这里不是直接把 return_max_logit 删掉,而是把底层 required_symbols 对齐到当前 flash-attn 库实际导出的 23 参数符号,同时保留了一个 24 参数 inline overload,让上层旧写法继续编译并转发到 23 参数实现。
也就是说,return_max_logit 只是被兼容层吞掉,不会影响现有上层调用;当前调用本来传的是 false,行为不变。
wooway777
force-pushed
the
fix/metax-videonsa-ops
branch
from
December 4, 2026 10:09
f06918f to
3fab2ca
Compare
This branch has not been deployed
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
Motivation
Closes #
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)Smoke Test Result
Test Results on Supported Platforms
Full `pytest` output (optional)
Benchmark / Performance Impact
Notes for Reviewers