Add AutoKernel example for an LLM optimizing GPU kernels#1527
Add AutoKernel example for an LLM optimizing GPU kernels#1527
Conversation
| ) | ||
| ) | ||
|
|
||
| app = modal.App("autokernel", image=image) |
There was a problem hiding this comment.
🟡 App name missing required example- prefix per repo convention
The internal/CLAUDE.md:148-152 rules explicitly require app names to use example- prefix with kebab-case (e.g., modal.App("example-vllm-inference")). The current code uses "autokernel" instead of "example-autokernel". While some older examples also lack this prefix, it is a clearly documented convention for new examples.
| app = modal.App("autokernel", image=image) | |
| app = modal.App("example-autokernel", image=image) |
Was this helpful? React with 👍 or 👎 to provide feedback.
| "curl -LsSf https://astral.sh/uv/install.sh | sh", | ||
| "curl -fsSL https://deb.nodesource.com/setup_20.x | bash -", | ||
| "apt-get install -y nodejs", | ||
| "npm install -g @anthropic-ai/claude-code", |
There was a problem hiding this comment.
🟡 Container dependency @anthropic-ai/claude-code is not version-pinned
The internal/CLAUDE.md:59-66 and the PR checklist both require all container image dependencies to be pinned to at least SemVer minor version. npm install -g @anthropic-ai/claude-code installs whatever version is latest at image build time. A breaking release of the Claude Code CLI could silently break the agent loop. This should be pinned, e.g., npm install -g @anthropic-ai/claude-code@1.0.3.
Prompt for agents
In 06_gpu_and_ml/agents/autokernel.py line 74, pin the @anthropic-ai/claude-code npm package to a specific version. Check the latest stable version and change the install command from:
npm install -g @anthropic-ai/claude-code
to something like:
npm install -g @anthropic-ai/claude-code@1.0.3
Similarly consider pinning the Node.js version (line 72-73 uses setup_20.x which is OK as a major version pin) and the uv installer (line 71 pulls latest). The uv installer is less critical since it's a build tool, but the Claude Code CLI is the primary dependency that drives the agent loop.
Was this helpful? React with 👍 or 👎 to provide feedback.
This runs AutoKernel on Modal. We setup Claude to do a long running optimization job on a Llama Model that identifies and optimizes bottlenecked parts of the model.
Here is how the results would look if you ran this:
result.txt
Type of Change
Monitoring Checklist
lambda-test: falseis provided in the example frontmatter and I have gotten approval from a maintainermodal run, or an alternativecmdis provided in the example frontmatter (e.g.cmd: ["modal", "serve"])cmdwith no arguments, or theargsare provided in the example frontmatter (e.g.args: ["--prompt", "Formula for room temperature superconductor:"]fastapito be installed locally (e.g. does not importrequestsortorchin the global scope or other code executed locally)Documentation Site Checklist
Content
modal-cdn.comOutside Contributors
You're great! Thanks for your contribution.