task-constructor

Extract PyTorch/Triton operator implementations into standardized KernelBench task files.

6|1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/xchang1121/AutoResearch-CC-hook --skill task-constructor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: task-constructor
Source: https://github.com/xchang1121/AutoResearch-CC-hook/tree/main/skills/task-constructor
Command: npx skills add https://github.com/xchang1121/AutoResearch-CC-hook --skill task-constructor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, and includes scripts (resource) and references (resource) components.

What problem does it solve?

从 PyTorch/Triton 代码仓中提取算子实现,构建为 KernelBench 格式的标准化单文件自包含任务。支持代码提取、AST 依赖追踪、函数内联、import 清理、格式验证和参考对比测试。当用户需要从现有代码构建 task_code 时使用此 Skill。

Core Features & Use Cases

  • 提取算子实现并打包为 KernelBench 单文件任务
  • 支持 AST 依赖追踪、函数内联、import 清理、格式验证和参考对比测试
  • 场景:从现有代码构建 task_code、包装代码片段生成 KernelBench 任务等

Quick Start

将代码仓路径提供给 task-constructor 并运行以生成一个自包含的 KernelBench 任务文件。

Frequently Asked Questions about task-constructor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a self-contained KernelBench task from existing PyTorch code?

Creating a self-contained KernelBench task from PyTorch code requires extracting operator implementations, tracing AST dependencies, inlining functions, and cleaning imports to form a validated single-file task. This skill automates that packaging process for reproducible benchmarking.

What does inlining dependencies and cleaning imports do for Triton codebases?

Inlining dependencies and cleaning imports for Triton codebases ensures the final task file is completely self-contained, removing external references so the code can run independently for reproducible KernelBench workflows and reference testing.

Can I use this to package code fragments for reference testing in KernelBench?

Yes, packaging code fragments for reference testing in KernelBench is supported. The tool extracts the target code, inlines required functions, validates the format, and enables direct reference comparisons through the provided testing tooling.

Do I need PyTorch installed to convert code into a KernelBench task?

PyTorch must be installed to convert code into a KernelBench task. The dependency is required because the skill extracts operator implementations directly from PyTorch codebases and validates them against reference testing workflows.

What is the best way to extract PyTorch operator implementations for reproducible benchmarking?

The best way to extract PyTorch operator implementations for reproducible benchmarking is using AST dependency tracking to identify required functions, inline them, and clean imports to generate a standardized single-file task.

Why does my extracted PyTorch code fail KernelBench format validation?

Extracted PyTorch code fails KernelBench format validation when external dependencies are not inlined or imports are not cleaned. The task must be a fully self-contained single file to pass validation and execute reproducible benchmarking.