Infer-forge:SGLangを中心としたHarness・Loop・Graphエンジニアリング

Infer-forge:SGLangを中心としたHarness・Loop・Graphエンジニアリング

1. はじめに

推論最適化はコードレベルの局所的な変更のように見えるが、その有効性はグローバルに影響する。カーネル・通信パス・スケジューリングの変更は、モデル・ワークロード・SLO・サービングトポロジー・ランタイムバージョン・アクセラレータープラットフォームが組み合わさって定義される特定のデプロイメントポイント上でのみ意味を持つ。同じパッチでも、あるデプロイメントポイントでは改善をもたらす一方、別のポイントでは性能後退を引き起こすことがある。

したがって最優先の要件は信頼性の高い実行である。デプロイメントポイントを再現するには、モデル能力だけでなく、ツール・環境・コンテキスト・メモリ・検証・セキュリティ境界の安定性も必要となる。Harness Engineeringはこれらの周辺条件を、再現可能かつ検査可能な実行システムへと変換し、抽象概念Agent = Model + Harnessの基盤を形成する。

The inference deployment space stacks five layers of static configuration. Model shows Ling, Qwen, DeepSeek, Kimi, GLM, and MiniMax. Serving Scenario runs Modality (text, image, video) into Traffic Shape (input and output length, media count, resolution, QPS, concurrency, cache reuse) into SLO (TTFT, TPOT, throughput, E2E latency). Serving Topology separates Deployment Architecture—Colocated PD, PD Disaggregation, and EPD Disaggregation, each listing the node roles it is built from — Prefill and Decode together, then Prefill and Decode as separate roles, then Encoder alongside them — from Parallelism—TP, PP, DP, and EP—because the two are chosen independently. Versioned Runtime Profiles is a stack of tabbed cards labelled Service A rev. 12, Service B rev. 7, and Service C rev. 21, plus a fourth paler card behind them all, blank and showing only its top edge, whose narrow tab carries an ellipsis for the profiles not drawn, the front card holding an Engine Configuration and a Container Image whose digest is pinned alongside its Framework, Device Runtime, and Collectives. Accelerator Platforms groups placeholder GPUs under Vendor A, B, and C. Arrows between the layers carry configuration dependency, not runtime data flow

2. 推論とはデプロイメント空間である

図1はデプロイメントポイントを具体的な制約チェーンへと変換したものである。モデルがサポートするモダリティと実行パスを決定し、サービングシナリオがモダリティとトラフィック形状をSLOへと変換し、さらにサービングトポロジーを制約し、最終的にバージョン管理されたランタイムプロファイルを通じてアクセラレータープラットフォーム上で実現される。

The infer-forge MonoRepo contains three groups: a Built-in Workspace; Inference Stack Repos centered on SGLang, including Dynamo, DeepGEMM, DeepEP, FlashMLA, FlashInfer, Humming, and Mooncake; and Harness Repos

3. MonoRepo

Infer-forgeはGitサブモジュールを通じて関連リポジトリを同一のルートディレクトリ下に配置することで、それぞれの履歴を保持しつつ、クロスリポジトリエンジニアリングへの安定したエントリーポイントを提供する。

The Task Loop moves from Task Definition into Main Loop, uses Task Goal Met? to continue or satisfy Exit Criteria, preserves Task Memory, and draws on four Harness capabilities

4. Task Loop

タスクループはタスク定義からメインループへと進み、「タスクゴール達成?」の判定により終了するかどうかを決定しながら、タスクメモリを保持し続ける。

Task Definition consists of Task Type, Starting Context, Task Contract, and Exit Criteria

Loop Execution defines a Loop Block, uses Execution Routing to choose Model Tier and Agent Topology independently, executes the block, and uses Task Goal Met? to exit or continue while Task Memory carries the Current Loop Block, a Loop Block Handoff, and the Next Loop Block across iterations

Node Registry combines periodic runtime and GPU observations to determine claim cleanup eligibility.

Skills are organized across SGLang Upstream, Cross-lib, Task, and Ops, while Tools & CLI include Deploy, Build, Pull Weights, Sync Code, Evaluate, Profile, Diagnose Online, and Monitor

Journal uses LLM-wiki to connect records from multiple Tasks and Multi-dim Index fields such as Model, Type, and GPU to support Retrieve, Compare, and Filter

Safety Guard constrains execution through Push Guard, Traceable Path, Env Isolation, Production Read-only Access, Secrets, Data, Human Gate, and Cross-Model Adversarial Review

Task Graph defines Task node, Shared repo, and External system as graph elements, shows Verification before Handoff, and distinguishes Handoff edge, State edge, and Control edge

5. 実装の現状

Infer-forgeはすでに社内で継続的に運用されており、4ヶ月間で並行タスクのピーク数が2から9へと増加し、1つのプロジェクトにおいて38件の検証可能なタスクノードを協調処理した実績がある。