Skip to content
Agentmart
Submit a tool

quark-create-shapeshifter-pass

Author a new ShapeShifter graph-transformation pass for AMD Quark (ONNX or PyTorch) so it conforms to the pass framework's conventions and auto-registers.

Skill by amd

IndexedMIT★ 186
Write a review

Chalk Labs

Need help deploying quark-create-shapeshifter-pass?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/amd-quark-create-shapeshifter-pass-99a133

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Author a new ShapeShifter graph-transformation pass for AMD Quark (ONNX or PyTorch) so it conforms to the pass framework's conventions and auto-registers. Use when a developer says "add a ShapeShifter pass", "create a new onnx_ or pytorch_ pass", "write a custom Quark graph transform", or "contribute a community ShapeShifter pass". Walks through choosing backend and name, subclassing ONNXPass/PytorchPass with the register_pass decorator, implementing _default_config and _run_for_config, adding a per-pass test, and documenting it. Developer-facing authoring tool, not an end-user quantization step.

Use cases: backend, testing, ml, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/quark-create-shapeshifter-pass

What's inside

Skill name
quark-create-shapeshifter-pass
Description
Author a new ShapeShifter graph-transformation pass for AMD Quark (ONNX or PyTorch) so it conforms to the pass framework's conventions and auto-registers. Use when a developer says "add a ShapeShifter pass", "create a new onnx_ or pytorch_ pass", "write a custom Quark graph transform", or "contribute a community ShapeShifter pass". Walks through choosing backend and name, subclassing ONNXPass/PytorchPass with the register_pass decorator, implementing _default_config and _run_for_config, adding a per-pass test, and documenting it. Developer-facing authoring tool, not an end-user quantization step.
License
MIT
Instructions
217 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# quark-create-shapeshifter-pass

## Purpose

Author a new ShapeShifter transformation pass that is correct on the first try. ShapeShifter is
Quark's pass-based graph-transformation framework (`quark/shapeshifter/`): each pass is a
self-contained unit that takes a model, applies one transformation, and returns it. Passes
auto-register by filename via a `@register_pass` decorator, so a new pass is usable from the CLI,
the Python API, and the ONNX quantizer's `ShapeShifterYaml` with zero manual wiring — **if** it
follows the naming, subclassing, and config conventions exactly. This skill replays those
conventions in authoring order and flags the non-obvious traps (defaults are not auto-applied;
class/file naming is load-bearing) so the developer focuses on the transformation logic.

## Inputs

- **Required**: the transformation the pass performs (one sentence); the backend it targets
  (ONNX `onnx.ModelProto` **or** PyTorch callable — a pass is one or the other, never both).
- **Required**: a pass name in `snake_case`, prefixed `onnx_` or `pytorch_` (this becomes the
  filename, the registry key, and the YAML key — pick it carefully).
- **Optional**: config parameters the pass exposes (name, type, default, whether required);
  whether it is a **core** pass (`quark/shapeshifter/passes/`) or a **community** pass
  (`quark/contrib/shapeshifter_community_passes/`); a minimal model that exercises it (for the test).

## Outputs: shapeshifter_pass.py

The primary artifact is the new pass module, written to
`quark/shapeshifter/passes/<pass_name>.py` (core) or
`quark/contrib/shapeshifter_community_passes/<pass_name>.py` (community). `<pass_name>` matches the
chosen name (e.g. `onnx_drop_identity.py`). Side-effect artifacts:

- `test/test_for_cli/test_shapeshifter_<pass_name>.py` — one test per pass (project convention).
- A documentation entry in `docs/source/quark_shapeshifter_onnx_passes.rst` (ONNX) or
  `docs/source/quark_shapeshifter_torch_passes.rst` (PyTorch).

No JSON schema — this artifact is Quark source code, not a cross-skill handoff artifact.

## Interaction Flow

1. **Intake** — capture the transformation, the backend, the pass name, and any config params.
   If the developer described the transform in prior conversation, extract these first.
2. **Route** — confirm backend (ONNX vs PyTorch) and core-vs-community placement; derive the
   file path, class name, and YAML key from the name.
3. **Plan** — present the file path, class skeleton, `_default_config` params, and the
   `_run_for_config` outline **before writing**. Confirm the name does not collide with an
   existing registry entry (`ls quark/shapeshifter/passes/`).
4. **Confirm** — get explicit approval before writing source files under `quark/`.
5. **Execute or Summarize** — write the pass, the test, and the doc entry; run the test and
   confirm the pass registers. Summarize what was created and how to invoke it.

## Backend & Placement Decision

| Question | Choose |
|----------|--------|
| Operates on `onnx.ModelProto` (a graph)? | ONNX pass → subclass `ONNXPass`, prefix `onnx_` |
| Operates on a PyTorch callable (`nn.Module`, function)? | PyTorch pass → subclass `PytorchPass`, prefix `pytorch_` |
| Officially maintained / production? | Core → `quark/shapeshifter/passes/` |
| Contributed / experimental? | Community → `quark/contrib/shapeshifter_community_passes/` |

A workflow must be **all-ONNX or all-PyTorch**; the Engine raises `ValueError` on mixing.

## Naming Rules (load-bearing)

- **Filename = pass name = registry key = YAML key.** `onnx_drop_identity.py` → pass name
  `onnx_drop_identity`, used verbatim under `passes:` in YAML. There is no separate name string.
- Prefix **`onnx_`** or **`pytorch_`**.
- Files starting with `_` (e.g. `__init__.py`) are **skipped** by discovery.
- **Class name must end in `Pass`** (only such classes are discovered / exported). Convention:
  `ONNX<Thing>Pass` / `Pytorch<Thing>Pass`.
- Duplicate pass names raise `ValueError` at import (with a core-vs-community conflict message).

## Authoring the Pass

Two required methods (see `quark/shapeshifter/pass_base.py`):

- `_default_config(self) -> dict[str, PassConfigParam]` — declare each config param with
  `PassConfigParam(type_, default_value, required, description)`; end with
  `config.update(self.config)` (the convention every pass follows).
- `_run_for_config(self, model, config) -> model` — the transformation. ONNX: takes/returns
  `onnx.ModelProto`. PyTorch: takes/returns any `Callable`.

**ONNX skeleton** (`quark/shapeshifter/passes/onnx_drop_identity.py`):

```python
#
# Copyright (C) 2025 - 2026 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#

from typing import Any

import onnx
from onnx import ModelProto
from onnxruntime.quantization.onnx_model import ONNXModel  # helpers: remove_nodes, etc.

from quark.common.utils.log import ScreenLogger
from quark.shapeshifter.pass_base import ONNXPass, register_pass
from quark.shapeshifter.pass_config import PassConfigParam

logger = ScreenLogger(__name__)


@register_pass
class ONNXDropIdentityPass(ONNXPass):
    """Remove Identity nodes from the graph."""

    def _default_config(self) -> dict[str, PassConfigParam]:
        config = {
            "drop_identity": PassConfigParam(
                type_=bool,
                default_value=True,
                required=True,
                description="Whether to remove Identity nodes.",
            ),
        }
        config.update(self.config)
        return config

    def _run_for_config(self, model: ModelProto, config: dict[str, Any]) -> ModelProto:
        # config is the RAW user dict from YAML — read values directly and

From amd/Quark, MIT.

More from amd/Quark

Signals

Stars
186
Forks
36
Open issues
3
Last commit (this folder)
Sep 28, 2026 (1 month ago)
Last release
Sep 28, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from amd

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get quark-create-shapeshifter-pass running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying quark-create-shapeshifter-pass?

CallGet help
Cite this page

quark-create-shapeshifter-pass skill. Agent Mart. https://agentmart.dev/skills/amd-quark-create-shapeshifter-pass-99a133 (last updated 2026-10-24)