Skip to content

Add nine-toothed-operator-dev skill for 2026 spring T3-1-1 by tusu-code#171

Open
tusu-code wants to merge 3 commits into
InfiniTensor:masterfrom
tusu-code:spring-2026-tusu-code-t3-1-1
Open

Add nine-toothed-operator-dev skill for 2026 spring T3-1-1 by tusu-code#171
tusu-code wants to merge 3 commits into
InfiniTensor:masterfrom
tusu-code:spring-2026-tusu-code-t3-1-1

Conversation

@tusu-code

@tusu-code tusu-code commented Jul 3, 2026

Copy link
Copy Markdown

[2026 Spring][T3-1-1] tusu-code

GitHub PR title (CONTRIBUTING-compliant, imperative, capitalized, no trailing punctuation):
Add nine-toothed-operator-dev skill for 2026 spring T3-1-1 by tusu-code
Branch: spring-2026-tusu-code-t3-1-1 (competition-required spring-2026-<githubid>-t3-1-1, lowercase kebab-case)

Skill

  • Name: nine-toothed-operator-dev
  • Team: 韩博 / tusu-code (solo)
  • Problem: T3-1-1 NineToothed Operator Development Skill

Scope

Applicable:

  • Elementwise and broadcast operators
  • Reduction and block operators
  • Non-contiguous, stride, and offset-sensitive tasks
  • Correctness tests against PyTorch or existing implementations
  • Benchmark, generated source, AOT build, and failing-test diagnosis

Not applicable:

  • NineToothed compiler core redesign
  • Hidden evaluation answers or task-specific bypasses
  • Online-only services or private credentials

Installation and Usage

Place the skill under:

skills/competition/nine-toothed-operator-dev/

Prompt:

Use the nine-toothed-operator-dev skill to implement this NineToothed operator task. Follow the required workflow, add correctness tests, run targeted validation, include benchmark evidence if performance-sensitive, and finish with changed files, commands, results, unsupported cases, and residual risk.

Self-Test Records

All GPU results from RTX 4090, torch 2.9.1+cu128, Triton 3.5.1, repo master c9ebd49.

Task Category Correctness Benchmark Notes
01-elementwise-add Elementwise/broadcast 1 passed in 5.58s 1 passed in 9.80s; custom 0.0512 ms vs torch 0.0205 ms Existing-op validation flow
02-softmax-reduction Reduction/block Core 1 passed in 1.86s Custom 0.0543 ms vs torch 0.0215 ms Examples benchmark blocked by Triton exact-match precheck; diagnosed as harness tolerance, not semantics
03-layout-stride-offset Layout-sensitive Root cause found (rank mismatch -> silent column-0 processing + empty_like contiguous fallback); both fixes allclose=True on GPU N/A Closed loop: repro -> root cause -> 2 fixes -> re-verify
04-performance-diagnosis Performance/diagnosis Core add/softmax passed AOT re-verified with nvcc 12.8: tests/test_aot.py 11 passed, 1 skipped in 892.77s; full remaining suite 200 passed in 737.82s Closed loop across two environments (runtime-only vs full toolkit image)
05-from-scratch-gelu Elementwise (from scratch) 4/4 allclose vs torch GELU(tanh) 0.99x-1.05x vs PyTorch, 2^16-2^24 Includes real NameError failure-diagnosis loop (application globals not captured)
06-from-scratch-l2norm Reduction/block (from scratch) 4/4 allclose, fp16/fp32, odd sizes 0.72x-0.80x of PyTorch time (20-28% faster, fused single kernel) Real performance win with evidence
07-ab-comparison Meta: with/without skill A 8/8, B 9/9 (incl. non-contiguous view) Both 0.50x-0.75x vs unfused torch baseline Controlled A/B, checklist A 8.5/10 vs B 10/10, contamination caveat disclosed

Before/After Comparison

Measured A/B experiment (examples/07-ab-comparison/task.md): same agent, same repo snapshot, same GPU, same task text (softmax-temperature operator), condition A without the skill, condition B with the skill.

Dimension Without Skill (A) With Skill (B) Improvement
Contract restatement Partial (design notes only) Full upfront contract section Complete task-semantics discipline
Layout coverage No non-contiguous test Non-contiguous transposed-view test, passing Covers the layout-sensitive grading axis
Output allocation Not reasoned torch.empty(shape) chosen over empty_like, citing documented pitfall Pitfall-cited design decision
Scalar parameter Tensor(0) (correct) Tensor(0) with documented rejection of constexpr alternative Reasoned trade-off
Risk documentation Limitations list Residual-risk section with one-line fallbacks Reviewable failure plan
Checklist score 8.5/10 10/10 Measured gap is a lower bound (A had indirect exposure to skill-derived artifacts; disclosed)

Validation Commands

python scripts/check_submission.py --skill-dir .   # Structure check passed (structure/completeness only)
python -m pytest tests/test_scripts.py -q          # 9 passed (helper-script automation, stdlib only, no GPU)
python -m pytest tests/test_add.py -q              # 1 passed in 8.69s
python -m pytest tests/test_softmax.py -q          # 1 passed in 1.86s
python -m pytest tests/test_aot.py -q              # 11 passed, 1 skipped in 892.77s (nvcc 12.8)
python -m pytest tests/ -q --deselect tests/test_aot.py  # 200 passed in 737.82s

Main-Repo Style and Lint Checks

Run against the added skill scripts, per CONTRIBUTING.md (all clean on the latest commit):

$ ruff format --check scripts/
4 files already formatted

$ ruff check scripts/
All checks passed!

$ python scripts/check_contributing_style.py <skill scripts>
(no output; exit 0)

pytest output:

$ python -m pytest tests/test_aot.py -q     # RTX 4090, torch 2.9.1+cu128, Triton 3.5.1, nvcc 12.8
11 passed, 1 skipped in 892.77s (0:14:52)

$ python -m pytest tests/ -q --deselect tests/test_aot.py
200 passed in 737.82s (0:12:17)

Compliance

  • HONOR_CODE.md signed
  • REFERENCE.md completed
  • No secrets or credentials
  • No hidden answers
  • No test bypasses
  • External references disclosed

Attachments

  • Competition reports (three documents, kept outside the skill runtime dir to keep the skill small and focused; each in .md + .pdf, packaged together with the skill and this PR description in the submission zip on the contest site):
    • Proposal: 九齿skill创新挑战_T3-1-1_提案.md (+ PDF) — dated 2026-06-26, planning only (motivation, design principles, workflow, self-test plan, milestones), no results
    • Mid-term report: 九齿skill创新挑战_T3-1-1_中期报告.md (+ PDF) — dated 2026-07-01, round-1 self-test checkpoint (elementwise/reduction passing; layout and AOT blockers found, root-cause pending)
    • Final report: 九齿skill创新挑战_T3-1-1_赛题报告.md (+ PDF) — dated 2026-07-02, all evidence loops closed (7 self-tests, correctness/benchmark, failure diagnosis, A/B comparison)
  • Report template scaffolded by the skill: skills/competition/nine-toothed-operator-dev/reports/final_report_template.md
  • Self-test records: skills/competition/nine-toothed-operator-dev/examples/*/task.md, tests/selftest_manifest.md
  • Reproduction scripts and runbook: gpu-session/ (RUNBOOK.md, selftest_gelu.py, selftest_l2norm.py, verify_layout_fix.py, ab_test_*_impl.py)

@tusu-code tusu-code changed the title [2026春季][T3-1-1] tusu-code — nine-toothed-operator-dev 算子开发skill Add nine-toothed-operator-dev skill for 2026 spring T3-1-1 by tusu-code Jul 3, 2026
- Sign HONOR_CODE.md with name, team, and date
- Slim the runtime dir: drop the filled report PDF and Markdown, keep only
  reports/final_report_template.md so the skill stays small and focused
- Make scripts/check_submission.py describe itself as a structure/completeness
  check and state what it does not verify
- Add tests/test_scripts.py covering the four helper scripts as subprocesses
- Note the automated script tests in tests/selftest_manifest.md
- Apply the repository contributing style to the helper scripts
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