collect-workloads

Collect and sanitize SGLang ML workloads into flashinfer-trace JSONL and safetensors.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Rockyeast/flashinfer-trace-dev --skill collect-workloads
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: collect-workloads
Source: https://github.com/Rockyeast/flashinfer-trace-dev/tree/main/.claude/skills/collect-workloads
Command: npx skills add https://github.com/Rockyeast/flashinfer-trace-dev --skill collect-workloads

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Auto-collect real-world workloads produced by SGLang inferences using FlashInfer logging, then sanitize results for inclusion in the flashinfer-trace dataset and preparation for PR submissions.

Core Features & Use Cases

  • Auto-detect and collect workloads from definitions across op_types using SGLang + FlashInfer Level 10 logging.
  • Sanitize per-call dumps into flashinfer-trace JSONL and safetensors for compact, reproducible workloads.
  • Default to sglang mode for end-to-end collection, with a direct mode fallback when FlashInfer APIs are not wired into SGLang.
  • Map raw dumps to the flashinfer-trace schema, align plan/run dumps, and prepare metadata for PRs to HuggingFace.
  • Output is ready for per-definition HuggingFace PRs, including workload JSONL, safetensors, and definition metadata.

Quick Start

Run the collect_workloads.py script in sglang mode with your target definitions and a flashinfer-trace directory to start automatic collection, sanitization, and optional PR submission.

Frequently Asked Questions about collect-workloads

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

FAQPage Schema
How do I collect real-world ML workloads from SGLang inferences for benchmarking?

You can collect SGLang inference workloads automatically by running the collection script in sglang mode, which uses FlashInfer Level 10 logging to auto-detect and gather per-call dumps for benchmarking.

What is FlashInfer logging used for when gathering inference traces?

FlashInfer logging captures raw per-call dumps during SGLang inferences, filtering logs by fi_api tags and mapping plan/run dumps to a workload schema for reproducible dataset preparation.

How do I sanitize raw inference dumps into JSONL and safetensors for HuggingFace PRs?

The collection script sanitizes raw dumps into flashinfer-trace JSONL and safetensors formats, aligning plan and run dumps while preparing definition metadata for direct HuggingFace PR submission.

Can I collect workloads if FlashInfer APIs are not wired into my SGLang environment?

Yes, you can use the direct API mode as a fallback when FlashInfer APIs are not integrated into SGLang, allowing you to gather workloads without the default end-to-end sglang mode.

How do I configure environment variables to ensure safe and targeted workload data collection?

You can set environment variables like FLASHINFER_LOGLEVEL and FLASHINFER_DUMP_INCLUDE to control logging behavior, ensuring targeted and safe data collection exported to a flashinfer-trace directory.

What are the limitations of using direct mode versus sglang mode for workload collection?

Sglang mode provides end-to-end workload collection across multiple op_types definitions, while direct mode serves as a fallback when FlashInfer APIs are absent, lacking the full automated pipeline integration.