Skip to content

Conversation

@GreenHandHand
Copy link

由于 Infinicore 中的 Infinicore.zeros 暂时没有实现,这里7549959824de555ed6c829fde5d8726609cb3bb5 手动实现了 zeros_ 用于初始化。

描述

Infinicore 赛题 T1-1-28,算子 bitwise_left_shift, fold, index_select, log2, mish 的 cpu 实现,gpu 部分实现使用 ninetoothed,在 ntops 的 pr 中。

值得陈述的技术和细节

  1. ninetoothed 框架下暂时不知道如何实现 padding 方法,因此这里用的是直接拓展张量到对应的 padding 维度,并使用 narrow 和 copy_ 来创建目标张量。所以,对于无 padding 的输入,效率接近 pytorch,但是有 padding 的输入效率很低。(fold 算子)
  2. 在 Triton 旧版本中不支持 gather 函数,index_select 的实现使用了不使用 gather 的版本。注释里有使用 gather 函数的版本。
  3. left_shift 操作在一些平台上对于未定义行为的结果没有进行处理(摩尔线程、天数),因此需要手动处理边界情况。

运行截图

cpu

summary bitwise_left_shift fold index_select log2 mish

nvidia

summary bitwise_left_shift fold index_select log2 mish

摩尔线程

summary bitwise_left_shift fold index_select log2 mish

沐曦

summary bitwise_left_shift fold index_select log2 mish

天数

summary bitwise_left_shift fold index_select log2 mish

HONOR_CODE

HONOR_CODE.md

@GreenHandHand GreenHandHand changed the title 2025 autumn green hand hand t1 1 28 [2025秋季][T1-1-28] GreenHandHand Dec 15, 2025
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