AGENT SKILL

mixtral-offloading

Use dvmazur/mixtral-offloading for source-only CUDA/HQQ/Triton Mixtral-8x7B expert offloading workflows.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
mixtral-offloading
license
MIT
metadata
{ "disco-role": "operating" }
description
Use dvmazur/mixtral-offloading for source-only CUDA/HQQ/Triton Mixtral-8x7B expert offloading workflows.
disable-model-invocation
true

02 资源文件 7

03 SKILL.md 正文

mixtral-offloading

Use this repo skill when a task involves the dvmazur/mixtral-offloading repository: efficient Mixtral-8x7B inference through mixed HQQ quantization, Triton matmul kernels, and MoE expert offloading between GPU and CPU memory.

Read this when

  • The user asks to run or adapt the Mixtral offloading demo notebook locally.
  • The task names OffloadConfig, QuantConfig, build_model, HQQLinearTritonSavable, ExpertCache, MixtralExpertWrapper, or SparseMoeWrapper.
  • The user is debugging CUDA/Triton/HQQ errors in a source-only checkout.
  • The user needs a safe smoke check that avoids model downloads and long interactive generation.

First checks

  1. This repository is source-only: it has no installable package metadata and no CLI. Future agents should install the runtime requirements and add the user's checkout root to PYTHONPATH before importing src.* modules.
  2. Actual offloaded inference is a CUDA workflow. CPU-only checks can validate imports, config math, and packing helpers, but not Mixtral generation or Triton kernel execution.
  3. The full demo depends on external Hugging Face model/tokenizer artifacts and a quantized safetensors state directory. Do not download large artifacts or start an interactive chat loop without explicit approval.

Minimal public setup pattern:

python -m pip install -r requirements.txt
PYTHONPATH="/path/to/user/mixtral-offloading" python -c "from src.build_model import build_model; print('ok')"
python /path/to/this-skill/scripts/check_environment.py --repo-root /path/to/user/mixtral-offloading --require-cuda

Run scripts/check_environment.py for dependency, source-import, and optional CUDA checks.

Route map

Repo-level references

Common task recipes

User wants to run the demo as a script

  1. Read the installation reference and verify dependencies/CUDA.
  2. Read the inference workflow reference.
  3. Render a skeleton with the inference sub-skill script.
  4. Validate the state directory before calling build_model.
  5. Start with short generation and low max_new_tokens.

User hits a quantization or Triton error

  1. Run the packing round-trip helper from the quantization sub-skill.
  2. If CUDA behavior matters, run its Triton smoke against the user's checkout.
  3. Inspect HQQ group sizes, packed weight shapes, and tensor contiguity.
  4. Route model-level issues back to inference only after the kernel check passes.

User is extending expert offloading

  1. Use the expert-cache plan helper to validate cache sizes and UIDs.
  2. Read cache/storage invariants before changing prefetch or eviction policy.
  3. Keep storage type/size/device consistent across all cached experts.
  4. Treat realistic cache construction as CUDA-backed unless using source-only reasoning.

Avoid using this skill when

  • The request is general Transformers usage unrelated to this repository's HQQ/Triton/offloading code.
  • The user needs fine-tuning, training, serving infrastructure, or quantization methods not implemented here.
  • The task is only to evaluate base Mixtral models without this repo's safetensors/offloading state layout.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351