Skip to content

Add 2026 spring T3-1-1 skill submission for junkai-kay#176

Open
junkai-kay wants to merge 1 commit into
InfiniTensor:masterfrom
junkai-kay:2026-spring-junkai-kay-t3-1-1
Open

Add 2026 spring T3-1-1 skill submission for junkai-kay#176
junkai-kay wants to merge 1 commit into
InfiniTensor:masterfrom
junkai-kay:2026-spring-junkai-kay-t3-1-1

Conversation

@junkai-kay

@junkai-kay junkai-kay commented Jul 12, 2026

Copy link
Copy Markdown

🏷 Skill Information

Skill name ninetoothed-operator-skill
Competition 2026 Spring AI Contest
Track T3-1-1 — NineToothed .skill Innovation Challenge
Participant Zhao Junkai
GitHub ID @junkai-kay
Branch 2026-spring-junkai-kay-t3-1-1
Skill path skills/competition/ninetoothed-operator-skill/

📖 Summary

本 skill 指导 AI 编码智能体完成 NineToothed GPU 算子开发全流程——从需求理解、DSL 实现、正确性测试、性能 benchmark,到失败诊断和 PR 集成。提供一套可执行的标准操作流程,涵盖 5 种 arrangement/application 模式,使 AI 面对陌生算子任务时自主完成语义提取、模式匹配、实现选型、测试覆盖和故障闭环。

所有 API 模式均基于 NineToothed 0.26 官方源码逐行对照验证,T1/T2/T3 共 37 个测试用例全部通过。

🎯 Scope

Category Capability Evidence
Elementwise / Broadcast Pattern B: 2D tile + expand;mask 条件、dtype、broadcast 边界 T1 — 12/12 PASSED
Reduction / Block Pattern D: (1, BLOCK_SIZE) tile + 无参归约;max-subtraction 数值稳定 T2 — 13/13 PASSED
Layout-Sensitive 4 种布局变体 (contiguous/transposed/sliced/offset) T3 — 12/12 PASSED
Performance / Diagnosis 17 配置 benchmark + 6 步诊断闭环 + Bug 复现 T4 — 完成

❌ Out of Scope

NVIDIA GPU only (CUDA 11.8+), float32 primary, static shapes, single GPU. CPU/macOS/Windows/dynamic shapes/float64/multi-GPU not tested. 详见 SKILL.md.

📦 Files Added

All under skills/competition/ninetoothed-operator-skill/ — SKILL.md, README.md, HONOR_CODE.md, REFERENCE.md, references/index.md, scripts/, tests/, logs/, reports/, examples/ (4 tasks).

pytest output: ```text
Environment: Tesla T4, CUDA 12.8, PyTorch 2.11.0, NineToothed 0.26.0
T1 — Masked Add with Broadcast: 12 passed in 122.26s
T2 — Tiled Softmax: 13 passed in 8.04s
T3 — Layout-Sensitive GELU: 12 passed in 7.69s


## 📊 Benchmark

Environment: Tesla T4, CUDA 12.8, PyTorch 2.11.0

**T1 — Masked Add (5 configs):** NineToothed overtakes PyTorch at large sizes (0.44x at 4096²)

**T2 — Softmax (6 configs):** Competitive or faster at most shapes. Single-row (1,4096): 3.53x slower due to launch overhead.

**T3 — GELU (4096×4096):** contiguous 1.00x, transposed **4.35x slower**, sliced 1.01x — directly proving layout sensitivity matters.

**T4 — 8-shape benchmark:** Completed on Tesla T4.

Raw logs: `logs/` directory.

## 🔬 Skill vs No-Skill

| | Without Skill | With Skill |
|---|---|---|
| API selection | Used `block_size()`, `ntl.max(dim=,keepdims=)`, `ntl.tanh()` — all unavailable | Reads official `tests/test_softmax.py` → correct `Symbol` + `@ninetoothed.jit` |
| T2 result | 13/13 CompilationError | 13/13 PASSED |
| T3 result | 12/12 CompilationError | 12/12 PASSED |
| Test coverage | 1 case | 10+ parameterized (boundaries, extremes, non-contiguous, dtype) |

## 🔧 Failure Diagnosis — Real Bug

Bug reproduced on Tesla T4 (2026-07-12): `ntl.max(input_row, dim=1, keepdims=True)` → `TypeError: max() got an unexpected keyword argument 'dim'`. Fix: `ntl.max(input_row)` without arguments, tile as `(1, BLOCK_SIZE)`. Full record in `examples/task4_benchmark_debug/diagnosis_record.md`.

## 🔗 Documents

- HONOR_CODE.md, REFERENCE.md in skill root
- Proposal, Mid-term Report, Final Report PDFs in `reports/`
- PR附件(三个PDF)已拖入下方评论区

## ✅ Compliance

- [x] Only files under `skills/competition/ninetoothed-operator-skill/`
- [x] No API keys, credentials, or secrets
- [x] No hidden evaluation answers
- [x] No deleted or bypassed tests
- [x] No fabricated results — all data traceable to `logs/`
- [x] ruff check: All checks passed
- [x] Branch: `2026-spring-junkai-kay-t3-1-1` (kebab-case, 32 chars)
- [x] AI tool usage disclosed in REFERENCE.md

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