MSProbe is a debugging tool for AI models that diagnoses accuracy anomalies and
numerical errors during model training and inference. It captures and monitors intermediate data (feature maps, weights,
activations, layer outputs) and contextual metadata (prompts, tensor dtypes, hardware configuration), and supports
visual analysis to systematically trace the root cause of accuracy degradation or numerical errors (e.g., NaN/Inf,
output drift, mismatched predictions).
MSProbe supports three accuracy levels for data dumping, each for different debugging needs:
L0: Dumps tensors/statistics at the module level and generates construct.json (for network structure
reconstruction in visualization). Requires passing a model/submodule handle.
L1: Dumps tensors/statistics at the torch API level, suitable for fine-grained API-level numerical checking.
mix: Combines L0 + L1, ideal for scenarios that require both graph reconstruction and numerical comparison.
MSProbe uses a JSON configuration file for customized data dumping. All core parameters are listed in the table below,
with the default JSON configuration provided for reference.
Type of dump task. Common PyTorch values include "statistics" and "tensor". A statistics task collects tensor statistics (mean, variance, max, min, etc.) while a tensor task captures arbitrary tensors.
Yes
dump_path
Directory where dump results are stored. When omitted, MSProbe uses its default path.
No
rank
Ranks to sample. An empty list collects every rank. For single-card tasks you must set this field to [].
No
step
Token iteration(s) to sample. An empty list means every iteration.
No
level
Dump level string ("L0", "L1", or "mix"). L0 targets nn.Module, L1 targets torch.api, and mix collects both.
Yes
async_dump
Whether to enable asynchronous dump (supported for PyTorch statistics/tensor tasks). Defaults to false.
No
scope
Customize the scope of dump. Provide two module or API names that follow the tool’s naming convention to lock a range, only data between the two names will be dumped. An empty list dumps every module or torch API.
The level setting determines what can be provided—modules when level=L0, APIs when level=L1, and either modules or APIs when level=mix.
No
list
Customize dump list, only dumps elements from the list. An empty list dumps every module or torch API. Options include:
•Supply the full names of specific APIs in PyTorch eager mode to only dump those APIs. Example: "list": ["Tensor.permute.1.forward", "Tensor.transpose.2.forward", "Torch.relu.3.backward"]. •When level=mix, you can provide module names so that the dump expands to everything produced while the module is running. Example: "list": ["Module.module.language_model.encoder.layers.0.mlp.ParallelMlp.forward.0"]. •Provide a substring such as "list": ["relu"] to dump every API whose name contains the substring. When level=mix, modules whose names contain the substring are also expanded.
Note: When MSProbe is enabled, cuda graph is disabled (disable_cuda_graph=True) because MSProbe only supports dump
in eager mode, warmup is disabled (skip_server_warmup=True) because there is no need to dump data for this stage.
MSProbe’s full debugging workflow follows Enable → Collect Data → Visualize → Analyze Root Cause. Below is a common
E2E example for SGLang-based model inference debugging.
Example : Advanced Debugging with Custom Configuration
Suitable for targeted debugging (e.g., only collect statistics data for specific ranks/steps, enable mix level for graph
reconstruction + numerical comparison) and root cause analysis via problem vs. benchmark comparison.
Send normal inference requests to trigger model running (MSProbe automatically collects data during request processing):
curl -H "Content-type: application/json" \ -X POST \ -d '{ "model": "Qwen/Qwen2.5-0.5B-Instruct", "messages": [ { "role": "user", "content": "Hello, my name is" } ], "max_tokens": 10 }' \ http://127.0.0.1:1027/v1/chat/completions
Problem side: Run the above SGLang server (with the accuracy/numerical issue) and send inference request; dump
data is saved to ./problem_dump.
Benchmark side: Launch a normal SGLang server (without the issue, e.g., stable framework version/operator) with
the same custom configuration and send the same inference request; rename the dump directory
to ./bench_dump.
Key Requirement: Problem and benchmark dumps must use the same inputs and sampling points (rank/step)
for valid comparison.
Check Generated Dump Files
Dump files are saved to ./problem_dump and ./bench_dump you defined and include core files for subsequent analysis:
dump.json: Records tensor metadata of APIs and modules (dtype, shape, min/max/mean, L2 norm, requires_grad, etc.).
stack.json: Logs call stack information of APIs and modules.
construct.json: hierarchical structure description, required for visualization, its content is not empty.
After the comparison or build task finishes, a compare_{timestamp}.vis.db file is created under graph_output.The dumped data can be used to visualize and analyze differences using tables or charts generated with visualization tools such as Matplotlib and Excel.
Divergent nodes (with accuracy/numerical differences) are highlighted in red (darker red = larger difference).
Click on divergent nodes to view detailed tensor data (inputs/outputs, parameters) and API/module call stacks.
Use the search/filter function to quickly locate key layers/APIs (e.g., “relu”, “conv”).
Switch between ranks/steps via the UI to check cross-rank/cross-step divergence.
Check the overflow check tab for NaN/Inf values in specific nodes (the direct cause of numerical instability).
Verify the Root Cause
After locating the divergent node (e.g., a specific Conv layer or torch API with abnormal tensor values), verify by:
Narrowing the dump scope to this node (via scope/list in the configuration file) for fine-grained data collection.
Modifying the problematic layer/API (e.g., replacing the operator, adjusting the dtype) and re-running the debugging
workflow to confirm the issue is resolved.
To confirm if MSProbe is installed, use pip show mindstudio-probe to troubleshoot. If it is installed, the MSProbe
version information will be printed. If it is confirmed that it has not been installed, please
use pip install mindstudio-probe --pre for installation;
Confirm the --msprobe-dump-config parameter points to the correct JSON file path.
├── problem_dump or bench_dump│ ├── step0│ │ ├── rank0│ │ │ ├── dump_tensor_data│ │ │ │ ├── Tensor.permute.1.forward.pt│ │ │ │ ├── Functional.linear.5.backward.output.pt # Format: {api_type}.{api_name}.{call_count}.{forward/backward}.{input/output}.{arg_index}.│ │ │ │ │ # arg_index is the nth input or output of the API. If an input is a list, keep numbering with decimals (e.g., 1.1 is the first element of the first argument).│ │ │ │ ├── Module.conv1.Conv2d.forward.0.input.0.pt # Format: {Module}.{module_name}.{class_name}.{forward/backward}.{call_count}.{input/output}.{arg_index}.│ │ │ │ ├── Module.conv1.Conv2d.forward.0.parameters.bias.pt # Module parameter data: {Module}.{module_name}.{class_name}.forward.{call_count}.parameters.{parameter_name}.│ │ │ │ └── Module.conv1.Conv2d.parameters_grad.weight.pt # Module parameter gradients: {Module}.{module_name}.{class_name}.parameters_grad.{parameter_name}. Gradients do not include call_count because the same gradient updates all invocations.│ │ │ │ # When the `model` argument passed to dump is a List[torch.nn.Module] or Tuple[torch.nn.Module], module-level data names also include the index inside the list ({Module}.{index}.*), e.g., Module.0.conv1.Conv2d.forward.0.input.0.pt.│ │ │ ├── dump.json│ │ │ ├── stack.json│ │ │ ├── dump_error_info.log│ │ │ └── construct.json│ │ ├── rank1│ │ │ ├── dump_tensor_data│ │ │ │ └── ...│ │ │ ├── dump.json│ │ │ ├── stack.json│ │ │ ├── dump_error_info.log│ │ │ └── construct.json│ │ ├── ...│ │ ││ │ └── rank7│ ├── step1│ │ ├── ...│ ├── step2
rank: Device ID. Each card writes its data to the corresponding rank{ID} directory. In non-distributed scenarios
the directory is simply named rank.
dump_tensor_data: Save the collected tensor data.
dump.json: Statistics for the forward data of each API or module, including names, dtype, shape, max, min, mean, L2
norm (square root of the L2 variance), and CRC-32 when summary_mode="md5".
See dump.json file description for details.
dump_error_info.log: Present only when the dump tool encountered an error and records the failure log.
stack.json: Call stacks for APIs/modules.
construct.json: Hierarchical structure description. Empty when level=L1.
An L0 dump.json contains forward/backward I/O for modules together with parameters and parameter gradients. Using
PyTorch’s Conv2d as an example, the network code looks like:output = self.conv2(input) # self.conv2 = torch.nn.Conv2d(64, 128, 5, padding=2, bias=True)dump.json contains the following entries:
Module.conv2.Conv2d.forward.0: Forward data of the module. input_args represents positional inputs, input_kwargs
represents keyword inputs, output stores forward outputs, and parameters stores weights/biases.
Module.conv2.Conv2d.parameters_grad: Parameter gradients (weight and bias).
Module.conv2.Conv2d.backward.0: Backward data of the module. input represents gradients that flow into the
module (gradients of the forward outputs) and output represents gradients that flow out (gradients of the module
inputs).
Note: When the model parameter passed to the dump API is List[torch.nn.Module] or Tuple[torch.nn.Module],
module-level names include the index inside the list ({Module}.{index}.*). Example: Module.0.conv1.Conv2d.forward.0.
An L1 dump.json records forward/backward I/O for APIs. Using PyTorch’s relu function as an
example (output = torch.nn.functional.relu(input)), the file contains:
Functional.relu.0.forward: Forward data of the API. input_args are positional inputs, input_kwargs are keyword
inputs, and output stores the forward outputs.
Functional.relu.0.backward: Backward data of the API. input represents the gradients of the forward outputs,
and output represents the gradients that flow back to the forward inputs.
A mix dump.json contains both L0 and L1 level data; the file format is the same as the examples above.
Was this page helpful?
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"SGLang Documentation","colors":{"primary":"#d55816","light":"#d55816","dark":"#d55816"},"logo":{"light":"https://mintcdn.com/lmsysorg/iZdDMbLWP1BLEIzC/logo/logo.png?fit=max\u0026auto=format\u0026n=iZdDMbLWP1BLEIzC\u0026q=85\u0026s=b27d467947ee2167744cb07b69badf00","dark":"https://mintcdn.com/lmsysorg/iZdDMbLWP1BLEIzC/logo/logo.png?fit=max\u0026auto=format\u0026n=iZdDMbLWP1BLEIzC\u0026q=85\u0026s=b27d467947ee2167744cb07b69badf00"},"favicon":"https://mintcdn.com/lmsysorg/iZdDMbLWP1BLEIzC/favicon.png?fit=max\u0026auto=format\u0026n=iZdDMbLWP1BLEIzC\u0026q=85\u0026s=5524ba9694253eabf4da70fafa1db208","background":{"decoration":"grid","color":{"light":"#fffcfb","dark":"#1d1d1d"}},"footer":{"socials":{"github":"https://github.com/sgl-project/sglang","x":"https://x.com/lmsysorg","linkedin":"https://www.linkedin.com/company/sgl-project/posts?feedView=all","slack":"https://slack.sglang.io/","discord":"https://discord.gg/4ugb2t6YY2"}},"seo":{"metatags":{"google-site-verification":"bX3ofyYQhraIpAYf4DpyZQXZO_G4xLR_RqeBAKnJA7g","canonical":"https://docs.sglang.io"}},"fonts":{"heading":{"family":"Inter","weight":600},"body":{"family":"Inter","weight":400}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lmsysorg","hasAudioNarration":false,"actualSubdomain":"lmsysorg","customDomains":["docs.sglang.io"],"gitSource":{"type":"github","owner":"sgl-project","repo":"sglang","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae164dbaaa04806a4a22cfc","collectionId":"6429690e-bd63-4dda-b040-43980c2f7afc","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae164dbaaa04806a4a22cfc"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae17c648359fafab8420621","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"Cookbook","count":327},{"language":"default","tag":"Autoregressive Models","count":121},{"language":"default","tag":"User Guide","count":98},{"language":"default","tag":"Hardware","count":66},{"language":"default","tag":"Hardware Platforms","count":66},{"language":"default","tag":"SGLang Diffusion","count":60},{"language":"default","tag":"Ascend NPUs","count":55},{"language":"default","tag":"Advanced Features","count":45},{"language":"default","tag":"Model Deployment","count":37},{"language":"default","tag":"Diffusion Models","count":34}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":"@keyframes sgdb-note-in{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}:where(*){scrollbar-width:none;-ms-overflow-style:none}:where(*)::-webkit-scrollbar{width:0;height:0}:where(pre, code, .code-block, .code-group, #request-example, #response-example, .sg-bench-scroll),:where(pre, code, .code-block, .code-group, #request-example, #response-example, .sg-bench-scroll) *{scrollbar-width:auto;-ms-overflow-style:auto}:where(pre, code, .code-block, .code-group, #request-example, #response-example, .sg-bench-scroll) ::-webkit-scrollbar,:where(pre, code, .code-block, .code-group, #request-example, #response-example, .sg-bench-scroll)::-webkit-scrollbar{width:10px;height:10px}table{width:100%;border-collapse:collapse;table-layout:fixed}table thead tr{border-bottom:2px solid #d55816}table thead th{text-align:left;padding:10px 12px;font-weight:700;white-space:nowrap}[data-theme=dark] table tbody tr:nth-child(odd) td,[data-theme=dark] table thead th:nth-child(odd),html.dark table tbody tr:nth-child(odd) td,html.dark table thead th:nth-child(odd),table tbody tr:nth-child(odd) td,table thead th:nth-child(odd){background-color:rgba(255,255,255,.02)}[data-theme=dark] table tbody tr:nth-child(even) td,[data-theme=dark] table thead th:nth-child(even),html.dark table tbody tr:nth-child(even) td,html.dark table thead th:nth-child(even),table tbody tr:nth-child(even) td,table thead th:nth-child(even){background-color:rgba(255,255,255,.05)}table tbody td{padding:9px 12px}table tbody td:first-child{font-weight:500}.sgd-model-catalog{margin:16px 0 24px;border-top:1px solid #e2e8f0}.sgd-model-entry{display:grid;grid-template-columns:minmax(138px,.34fr) minmax(0,1fr);column-gap:28px;min-width:0;padding:17px 0;border-bottom:1px solid #e2e8f0}.sgd-model-entry-ids,.sgd-model-entry-meta{min-width:0}.sgd-model-entry-meta h3{margin:0;color:#0f172a;font-size:.9rem;font-weight:650;letter-spacing:0;line-height:1.4}.sgd-model-id{min-width:0;padding:2px 0}.sgd-model-entry .sgd-model-id code{display:block;min-width:0;padding:0;border:0;background:0 0;box-shadow:none;color:#334155;font-size:.78rem;font-weight:500;line-height:1.5;overflow-wrap:anywhere;white-space:normal}.sgd-model-entry-note{margin:7px 0 0;color:#64748b;font-size:.76rem;line-height:1.45}.sgd-model-entry-link{display:inline-flex;gap:4px;align-items:center;margin-top:7px;color:#c2410c;font-size:.74rem;font-weight:600;text-decoration:none}.sgd-model-entry-link:hover{text-decoration:underline}@media (max-width:620px){.sgd-model-entry{grid-template-columns:minmax(0,1fr);row-gap:9px;padding:15px 0}.sgd-model-entry-meta{display:flex;align-items:baseline;justify-content:space-between;gap:16px}.sgd-model-entry-link{flex:none;margin-top:0}}.sgd-chip{display:inline-flex;align-items:center;margin:2px 4px 2px 0;padding:2px 8px;border:1px solid rgba(213,88,22,.22);border-radius:999px;background:rgba(213,88,22,.08);color:#9a3412;font-size:.75rem;font-weight:650;line-height:1.45}.sgd-model-tags{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0 30px}.sgd-model-tags .sgd-chip{margin:0;padding:4px 9px;border:0;background:#eef2ff;color:#3730a3;font-size:12px;font-weight:750;line-height:1.4}.sgd-model-tags+h2{margin-top:0}.prose:has(.sgd-model-tags){overflow-x:clip;overflow-y:visible}.sg-command-visualizer:not(.sgd-command-builder) :where(button:not(:disabled), .sg-command-visualizer-choice[aria-disabled=\"false\"], .sg-command-visualizer-tab){transition:transform 160ms ease-out,border-color 160ms ease-out,background-color 160ms ease-out,color 160ms ease-out}@media (hover:hover) and (pointer:fine){.sg-command-visualizer:not(.sgd-command-builder) :where(button:not(:disabled), .sg-command-visualizer-choice[aria-disabled=\"false\"], .sg-command-visualizer-tab):hover{transform:translateY(-1px) scale(1.015)}}.sg-command-visualizer:not(.sgd-command-builder) :where(button:not(:disabled), .sg-command-visualizer-choice[aria-disabled=\"false\"], .sg-command-visualizer-tab):active{transform:translateY(0) scale(.985)}.sg-command-visualizer:not(.sgd-command-builder) :where(button, .sg-command-visualizer-choice, .sg-command-visualizer-tab):focus-visible{outline:2px solid #e2775f;outline-offset:2px}@media (prefers-reduced-motion:reduce){.sg-command-visualizer:not(.sgd-command-builder) :where(button, .sg-command-visualizer-choice, .sg-command-visualizer-tab){transition:none;transform:none!important}}.sgd-command-builder{container:command-builder/inline-size;--sgdb-surface:white;--sgdb-raised:white;--sgdb-ink:oklch(22% 0.02 258);--sgdb-muted:oklch(50% 0.02 258);--sgdb-line:oklch(90% 0.008 258);--sgdb-brand:oklch(57% 0.15 35);--sgdb-serve:oklch(56% 0.13 40);--sgdb-request:oklch(60% 0.12 62);--sgdb-ok:oklch(52% 0.11 153);--sgdb-warn:oklch(59% 0.12 78);--sgdb-error:oklch(53% 0.16 25);--sgdb-well:oklch(45% 0.03 258 / 0.08);--sgdb-well-inset:inset 0 1px 2px oklch(30% 0.03 258 / 0.07);--sgdb-thumb-bg:linear-gradient(180deg, white, oklch(98.5% 0.003 258));--sgdb-thumb-shadow:0 0 0 0.5px oklch(30% 0.02 258 / 0.1),\n inset 0 1px 0 rgba(255, 255, 255, 0.9),\n 0 1px 1px oklch(30% 0.02 258 / 0.07),\n 0 4px 12px oklch(30% 0.02 258 / 0.1);--sgdb-pick-hover:oklch(45% 0.03 258 / 0.05);--sgdb-code-bg:oklch(97.5% 0.004 258);--sgdb-code-inset:oklch(30% 0.03 258 / 0.06);--sgdb-ease:cubic-bezier(0.32, 0.72, 0, 1);--sgdb-ease-dur:200ms;--sgdb-spring:cubic-bezier(0.3, 1.35, 0.45, 1);--sgdb-spring-dur:460ms;max-width:100%;margin:24px 0 40px;overflow:clip;border:1px solid var(--sgdb-line);border-radius:16px;background:var(--sgdb-surface);box-shadow:0 1px 2px oklch(30% .03 258/.04),0 12px 32px -12px oklch(30% .03 258/.12);color:var(--sgdb-ink)}.sgd-command-builder *,.sgd-command-builder ::after,.sgd-command-builder ::before{box-sizing:border-box}.sgd-command-builder :where(button, input, select){font:inherit}.sgd-builder-scope-tabs{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:12px 12px 0;padding:3px;border-radius:11px;background:var(--sgdb-well);box-shadow:var(--sgdb-well-inset)}.sgd-builder-scope-tabs::before{position:absolute;top:3px;bottom:3px;left:3px;width:calc((100% - 6px)/3);border-radius:8px;background:var(--sgdb-thumb-bg);box-shadow:var(--sgdb-thumb-shadow);content:\"\";transition:transform 300ms var(--sgdb-ease)}.sgd-builder-scope-tabs:has(>button:nth-child(2)[data-active=true])::before{transform:translateX(100%)}.sgd-builder-scope-tabs:has(>button:nth-child(3)[data-active=true])::before{transform:translateX(200%)}.sgd-builder-scope-tabs button{position:relative;z-index:1;min-width:0;min-height:34px;padding:0 4px;border:0;background:0 0;color:var(--sgdb-muted);cursor:pointer;font-size:12px;font-weight:590;white-space:nowrap;transition:color var(--sgdb-ease-dur) var(--sgdb-ease)}.sgd-builder-scope-tabs button[data-active=true]{color:var(--sgdb-ink)}.sgd-builder-main{display:flex;min-width:0;flex-direction:column}.sgd-builder-controls,.sgd-builder-output-rail{min-width:0}.sgd-builder-controls{container:builder-controls/inline-size;padding:4px 16px 20px}.sgd-builder-docs-tip{display:block;margin:0;padding:12px 16px;border-top:1px solid var(--sgdb-line);color:var(--sgdb-muted);font-size:12px;line-height:1.5}.sgd-builder-docs-tip a{color:var(--sgdb-serve);text-decoration:underline;text-underline-offset:3px}.sgd-builder-scope-panel{display:grid;gap:0}.sgd-builder-recipe{display:flex;min-width:0;padding:11px 0;gap:12px;align-items:center;justify-content:space-between;border-bottom:1px solid var(--sgdb-line)}.sgd-builder-recipe>div:first-child{display:grid;min-width:0;gap:3px}.sgd-builder-recipe>div:first-child span{color:var(--sgdb-muted);font-size:10.5px}.sgd-builder-recipe>div:first-child strong{font-size:12px;font-weight:590;line-height:1.4}.sgd-builder-recipe>div:last-child{display:flex;flex:none;gap:10px;align-items:center}.sgd-builder-recipe>div:last-child>small{color:var(--sgdb-muted);font-size:10px}.sgd-builder-section{min-width:0;padding:13px 0;border-bottom:1px solid var(--sgdb-line)}.sgd-builder-section:last-child{border-bottom:0}.sgd-builder-section-heading{display:flex;gap:8px;align-items:baseline;justify-content:space-between;margin-bottom:8px}.sgd-builder-section-heading>span{font-size:12px;font-weight:590}.sgd-builder-section-heading>small{color:var(--sgdb-muted);font-size:11px;line-height:1.35;text-align:right}.sgd-builder-choice-grid,.sgd-builder-hardware-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px;padding:3px;border-radius:11px;background:var(--sgdb-well);box-shadow:var(--sgdb-well-inset)}.sgd-builder-choice,.sgd-builder-hardware{position:relative;display:grid;min-width:0;padding:7px 10px;overflow:hidden;align-content:center;border:0;border-radius:8px;background:0 0;color:color-mix(in oklch,var(--sgdb-ink) 72%,transparent);cursor:pointer;font-size:12px;line-height:1.25;text-align:left;transition:background-color var(--sgdb-ease-dur) var(--sgdb-ease),color var(--sgdb-ease-dur) var(--sgdb-ease)}.sgd-builder-choice{min-height:38px}.sgd-builder-hardware{display:flex;min-height:34px;flex-flow:row wrap;align-items:baseline;gap:5px}.sgd-builder-hardware strong{font-size:12.5px;font-weight:590;letter-spacing:-.01em}.sgd-builder-choice small,.sgd-builder-hardware small{color:var(--sgdb-muted);font-size:10.5px}.sgd-builder-choice small{margin-top:1px}.sgd-builder-hardware small{margin-top:0}.sgd-builder-choice-dot{display:none}.sgd-builder-choice[data-selected=true],.sgd-builder-hardware[data-selected=true]{background:var(--sgdb-thumb-bg);box-shadow:var(--sgdb-thumb-shadow);color:var(--sgdb-ink)}.sgd-builder-choice:disabled,.sgd-builder-choice[data-blocked=true],.sgd-builder-hardware:disabled{cursor:not-allowed;opacity:.42}.sgd-builder-blocked-note{margin:8px 2px 0;color:var(--sgdb-warn);font-size:11px;line-height:1.45;animation:sgdb-note-in 220ms var(--sgdb-ease)}.sgd-builder-choice[data-soft=true][data-selected=true]::after{content:\"Not verified yet\";color:var(--sgdb-warn);font-size:10px;line-height:1.3;margin-top:1px}.sgd-builder-resource-grid{display:grid;gap:8px}.sgd-builder-stepper-field{display:flex;min-height:42px;padding:5px 6px 5px 12px;align-items:center;justify-content:space-between;border:0;border-radius:10px;background:var(--sgdb-well);box-shadow:var(--sgdb-well-inset)}.sgd-builder-stepper-field>div:first-child{display:grid;gap:2px}.sgd-builder-stepper-field span{font-size:12px;font-weight:500}.sgd-builder-stepper-field small{color:var(--sgdb-muted);font-size:10px}.sgd-builder-stepper{display:grid;grid-template-columns:28px 40px 28px;align-items:center;border-radius:8px;background:var(--sgdb-thumb-bg);box-shadow:var(--sgdb-thumb-shadow)}.sgd-builder-request-stepper button,.sgd-builder-stepper button{min-width:28px;min-height:30px;padding:0;border:0;border-radius:8px;background:0 0;color:var(--sgdb-ink);cursor:pointer;font-size:14px;transition:background-color var(--sgdb-ease-dur) var(--sgdb-ease)}.sgd-builder-stepper input{width:40px;height:30px;padding:0;border-right:.5px solid color-mix(in oklch,var(--sgdb-ink) 10%,transparent);border-left:.5px solid color-mix(in oklch,var(--sgdb-ink) 10%,transparent);border-top:0;border-bottom:0;border-radius:0;appearance:textfield;background:0 0;color:var(--sgdb-ink);font-size:12px;font-variant-numeric:tabular-nums;font-weight:590;line-height:30px;text-align:center}.sgd-builder-request-stepper input::-webkit-inner-spin-button,.sgd-builder-request-stepper input::-webkit-outer-spin-button,.sgd-builder-stepper input::-webkit-inner-spin-button,.sgd-builder-stepper input::-webkit-outer-spin-button{margin:0;appearance:none}.sgd-builder-request-stepper button:disabled,.sgd-builder-stepper button:disabled{opacity:.32;cursor:not-allowed}.sgd-builder-resource-summary{margin:8px 0 0;color:var(--sgdb-muted);font-size:11px;line-height:1.4}.sgd-builder-topology-toggle{margin-top:10px}.sgd-builder-text-action{justify-self:start;min-height:32px;padding:0;border:0;background:0 0;color:var(--sgdb-muted);cursor:pointer;font-size:11px;font-weight:500}.sgd-builder-text-action:disabled{cursor:not-allowed;opacity:.4}.sgd-builder-advanced{margin-top:12px;padding-top:12px;border-top:1px solid var(--sgdb-line)}.sgd-builder-advanced>p{margin:0 0 12px;color:var(--sgdb-muted);font-size:11px;line-height:1.5}.sgd-builder-topology-inputs{display:grid;gap:8px}.sgd-builder-topology-inputs label{display:grid;gap:5px;color:var(--sgdb-muted);font-size:10.5px}.sgd-builder-topology-inputs select{width:100%;min-height:38px;padding:0 8px;border:1px solid var(--sgdb-line);border-radius:6px;background:var(--sgdb-raised);color:var(--sgdb-ink);font-size:12px}.sgd-builder-messages{margin-top:12px;padding:8px 10px;border-radius:6px;background:color-mix(in oklch,var(--sgdb-warn) 9%,transparent);color:color-mix(in oklch,var(--sgdb-warn) 75%,var(--sgdb-ink))}.sgd-builder-messages[data-state=error]{background:color-mix(in oklch,var(--sgdb-error) 9%,transparent);color:color-mix(in oklch,var(--sgdb-error) 78%,var(--sgdb-ink))}.sgd-builder-messages :is(p, [data-as=\"p\"]){display:block;margin:0;font-size:11px;line-height:1.45}.sgd-builder-messages :is(p, [data-as=\"p\"])+:is(p, [data-as=\"p\"]){margin-top:5px}.sgd-builder-setting-item,.sgd-builder-setting-layout,.sgd-builder-setting-list{min-width:0}.sgd-builder-setting-item{border-bottom:1px solid var(--sgdb-line)}.sgd-builder-setting-item:last-child{border-bottom:0}.sgd-builder-setting-row{display:grid;grid-template-columns:minmax(76px,auto) minmax(0,1fr) auto auto;width:100%;min-height:44px;padding:8px;gap:8px;align-items:center;border:0;border-bottom:0;border-radius:8px;background:0 0;transition:background-color var(--sgdb-ease-dur) var(--sgdb-ease),color var(--sgdb-ease-dur) var(--sgdb-ease);color:var(--sgdb-ink);cursor:pointer;text-align:left}.sgd-builder-setting-row>span:first-child{color:var(--sgdb-muted);font-size:11px}.sgd-builder-setting-row strong{overflow:hidden;font-size:12px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.sgd-builder-setting-row small{color:var(--sgdb-ok);font-size:10px;font-weight:500}.sgd-builder-setting-row>span:last-child{color:var(--sgdb-muted);font-size:17px}.sgd-builder-setting-row[data-active=true]{background:color-mix(in oklch,var(--sgdb-serve) 4%,transparent);color:var(--sgdb-serve)}.sgd-builder-context{padding:16px 0 4px}.sgd-builder-context--inline{padding:12px 4px 16px;border-top:1px solid var(--sgdb-line)}.sgd-builder-context--rail{display:none}.sgd-builder-context-heading{display:flex;align-items:start;justify-content:space-between;gap:12px}.sgd-builder-context-heading>div>span,.sgd-builder-output-title strong{font-size:13px;font-weight:590}.sgd-builder-context-heading :is(p, [data-as=\"p\"]){display:block;margin:4px 0 0;color:var(--sgdb-muted);font-size:11px;font-weight:400;line-height:1.45}.sgd-builder-context-heading>small{flex:none;color:var(--sgdb-muted);font-size:10px}.sgd-builder-context-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}.sgd-builder-context-note{margin-top:12px;padding-top:10px;border-top:1px solid var(--sgdb-line)}.sgd-builder-context-note :is(p, [data-as=\"p\"]){display:block;margin:0;color:var(--sgdb-muted);font-size:11px;line-height:1.5}.sgd-builder-context-note a{display:inline-flex;margin-top:8px;min-height:24px;align-items:center;gap:5px;color:var(--sgdb-serve);font-size:11px;font-weight:500;text-decoration:none;transition:color var(--sgdb-ease-dur) var(--sgdb-ease)}.sgd-builder-context-note a+a{margin-left:16px}.sgd-builder-context-note a svg{flex:none;transition:transform var(--sgdb-ease-dur) var(--sgdb-ease)}.sgd-builder-context-note a:hover{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}.sgd-builder-context-note a:hover svg{transform:translateX(1px) scale(1.08)}.sgd-builder-scope-panel[data-scope=request] .sgd-builder-context-note a{color:var(--sgdb-request)}.sgd-builder-request-stepper{display:grid;grid-template-columns:40px 52px 40px auto;gap:6px;align-items:center;margin-top:14px}.sgd-builder-request-stepper input{width:52px;min-width:0;height:34px;padding:0 4px;border:1px solid var(--sgdb-line);border-radius:6px;appearance:textfield;background:var(--sgdb-surface);color:var(--sgdb-ink);font-size:16px;font-variant-numeric:tabular-nums;font-weight:590;text-align:center}.sgd-builder-request-stepper>span{margin-left:4px;color:var(--sgdb-muted);font-size:11px}.sgd-builder-request-setting{border-bottom:1px solid var(--sgdb-line)}.sgd-builder-request-setting:last-child{border-bottom:0}.sgd-builder-request-setting .sgd-builder-context{padding:16px 0}.sgd-builder-output-rail{display:grid;gap:12px;padding:0 12px 16px;align-items:stretch}.sgd-builder-output{--output-accent:var(--sgdb-serve);display:flex;min-width:0;flex-direction:column;overflow:hidden;border:1px solid var(--sgdb-line);border-radius:12px;background:var(--sgdb-raised);box-shadow:0 1px 2px oklch(30% .03 258/.05);transition:border-color 160ms ease-out,transform 160ms ease-out}.sgd-builder-output[data-output=request]{--output-accent:var(--sgdb-request)}.sgd-builder-output[data-emphasized=true]{border-color:color-mix(in oklch,var(--output-accent) 24%,var(--sgdb-line))}.sgd-builder-output>header{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:8px;align-items:center;min-height:50px;padding:8px 10px;border-bottom:1px solid var(--sgdb-line)}.sgd-builder-output[data-emphasized=true]>header{background:linear-gradient(180deg,color-mix(in oklch,var(--output-accent) 7%,transparent),color-mix(in oklch,var(--output-accent) 2%,transparent))}.sgd-builder-output-index{display:grid;width:20px;height:20px;place-items:center;border:0;border-radius:50%;background:var(--sgdb-well);color:var(--sgdb-muted);font-size:10px;font-weight:590;font-variant-numeric:tabular-nums}.sgd-builder-output-title{display:flex;min-width:0;gap:7px;align-items:baseline}.sgd-builder-output-tabs button,.sgd-builder-output-title span,.sgd-builder-status{color:var(--sgdb-muted);font-size:10.5px}.sgd-builder-status{display:inline-flex;gap:5px;align-items:center;font-size:10px;white-space:nowrap}.sgd-builder-status>span{width:6px;height:6px;border-radius:50%;background:var(--sgdb-warn);box-shadow:0 0 6px color-mix(in oklch,var(--sgdb-warn) 60%,transparent)}.sgd-builder-status[data-status=verified]>span{background:var(--sgdb-ok)}.sgd-builder-status[data-status=error]>span{background:var(--sgdb-error)}.sgd-builder-output-tabs{display:flex;min-height:38px;padding:5px 10px;gap:14px;align-items:center;border-bottom:1px solid var(--sgdb-line)}.sgd-builder-output-tabs button{min-height:28px;padding:0;border:0;border-bottom:1px solid transparent;background:0 0;cursor:pointer;font-weight:500}.sgd-builder-output-tabs button[data-selected=true]{border-bottom-color:var(--output-accent);color:var(--sgdb-ink)}.sgd-builder-node-fields{display:grid;grid-template-columns:minmax(0,1fr) 84px;gap:8px;padding:8px 10px;border-bottom:1px solid var(--sgdb-line)}.sgd-builder-node-fields label{display:grid;min-width:0;gap:4px;color:var(--sgdb-muted);font-size:10px}.sgd-builder-node-fields input{width:100%;min-width:0;min-height:34px;padding:0 7px;border:1px solid var(--sgdb-line);border-radius:6px;background:var(--sgdb-surface);color:var(--sgdb-ink);font-size:11px}.sgd-builder-code{position:relative;display:grid;min-width:0;flex:1 1 auto}.sgd-builder-code>pre{height:100%;max-height:calc(13.95em + 24px);min-width:0;margin:0;padding:12px;overflow:auto;border:0;border-radius:0;background:var(--sgdb-code-bg);box-shadow:inset 0 1px 3px var(--sgdb-code-inset);color:var(--sgdb-ink);font-size:clamp(11.5px,1.2cqi,12.5px);line-height:1.55;white-space:pre}.sgd-builder-code>pre::-webkit-scrollbar-corner{background:0 0}.sgd-builder-code>pre.is-expanded{height:auto;max-height:70vh}.sgd-builder-output code{background:0 0;color:inherit;font:inherit;font-variant-ligatures:none}.sgd-builder-output-error{padding:8px 10px;border-top:1px solid color-mix(in oklch,var(--sgdb-error) 35%,var(--sgdb-line));background:color-mix(in oklch,var(--sgdb-error) 8%,transparent);color:var(--sgdb-error);font-size:10.5px;line-height:1.4}.sgd-builder-output>footer{display:flex;min-height:44px;padding:5px 10px;align-items:center;justify-content:space-between;border-top:1px solid var(--sgdb-line)}.sgd-builder-output>footer>div{display:flex;margin-left:auto;gap:12px;align-items:center}.sgd-builder-copy{position:absolute;top:7px;right:7px;display:grid;width:28px;height:28px;padding:0;border:0;border-radius:7px;background:var(--sgdb-thumb-bg);-webkit-backdrop-filter:blur(8px) saturate(1.4);backdrop-filter:blur(8px) saturate(1.4);box-shadow:var(--sgdb-thumb-shadow);color:var(--sgdb-muted);cursor:pointer;opacity:0;place-items:center;transform:translateY(2px) scale(.9);transition:opacity var(--sgdb-ease-dur) var(--sgdb-ease),color var(--sgdb-ease-dur) var(--sgdb-ease),transform var(--sgdb-spring-dur) var(--sgdb-spring)}.sgd-builder-code:hover>.sgd-builder-copy,.sgd-builder-copy:focus-visible,.sgd-builder-copy[data-copied=true]{opacity:1;transform:translateY(0) scale(1)}@media (hover:none){.sgd-builder-copy{opacity:1;transform:none}}.sgd-builder-copy:disabled{cursor:not-allowed;color:color-mix(in oklch,var(--sgdb-muted) 45%,transparent)}.sgd-builder-copy svg{grid-area:1/1;pointer-events:none;transition:opacity 140ms var(--sgdb-ease),transform 220ms var(--sgdb-ease)}.sgd-builder-copy .sgd-builder-copy-check,.sgd-builder-copy[data-copied=true] .sgd-builder-copy-glyph{opacity:0;transform:scale(.5)}.sgd-builder-copy[data-copied=true]{color:var(--sgdb-ok)}.sgd-builder-copy[data-copied=true] .sgd-builder-copy-check{opacity:1;transform:scale(1)}@media (hover:hover) and (pointer:fine){.sgd-builder-scope-tabs button:not(:disabled):hover,.sgd-command-builder button:not(:disabled):not([data-blocked=true]):hover{color:var(--sgdb-ink)}.sgd-builder-choice:not(:disabled):not([data-blocked=true]):not([data-selected=true]):hover,.sgd-builder-hardware:not(:disabled):not([data-selected=true]):hover,.sgd-builder-request-stepper button:not(:disabled):hover,.sgd-builder-stepper button:not(:disabled):hover{background:var(--sgdb-pick-hover)}.sgd-builder-setting-row:not(:disabled):hover{background:color-mix(in oklch,var(--sgdb-serve) 5%,transparent)}.sgd-builder-copy:not(:disabled):hover{color:var(--sgdb-ink)}.sgd-builder-copy[data-copied=true]:hover{color:var(--sgdb-ok)}.sgd-builder-text-action:not(:disabled):hover{color:var(--output-accent, var(--sgdb-brand))}}.sgd-command-builder :where(button, input, select, a):focus-visible{outline:2px solid color-mix(in oklch,var(--sgdb-brand) 76%,white);outline-offset:2px}.sgd-command-builder button:not(:disabled):not([data-blocked=true]):active{transform:scale(.97);transition-duration:60ms}@container builder-controls (min-width: 560px){.sgd-builder-scope-panel[data-scope=base]{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:28px}.sgd-builder-scope-panel[data-scope=base]>.sgd-builder-recipe{grid-column:1/-1}.sgd-builder-scope-panel[data-scope=base] .sgd-builder-resource-grid{grid-template-columns:minmax(0,1fr)}.sgd-builder-setting-layout{display:grid;grid-template-columns:minmax(240px,.9fr) minmax(0,1.1fr)}.sgd-builder-setting-list{padding-right:16px;border-right:1px solid var(--sgdb-line)}.sgd-builder-context--inline{display:none}.sgd-builder-context--rail{display:block;padding:12px 0 4px 16px}.sgd-builder-request-direct{grid-template-columns:repeat(2,minmax(0,1fr))}.sgd-builder-request-setting{padding-right:16px;border-right:1px solid var(--sgdb-line);border-bottom:0}.sgd-builder-request-setting+.sgd-builder-request-setting{padding-right:0;padding-left:16px;border-right:0}}@container command-builder (max-width: 717px){.sgd-builder-output-rail{display:contents}.sgd-builder-controls{order:0}.sgd-builder-output{width:calc(100% - 24px);margin:12px 12px 16px;order:1}.sgd-builder-main[data-scope=request] .sgd-builder-output[data-output=request],.sgd-builder-main[data-scope=serve] .sgd-builder-output[data-output=serve]{order:-1}}@container command-builder (min-width: 718px) and (max-width: 957px){.sgd-builder-output-rail{order:-1;padding-top:12px}.sgd-builder-main[data-scope=base] .sgd-builder-output-rail{order:1;padding-top:0}.sgd-builder-output[data-emphasized=false]{order:1}}@container command-builder (min-width: 418px){.sgd-builder-scope-tabs{margin-inline:16px}.sgd-builder-scope-tabs button{font-size:13px}.sgd-builder-hardware-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.sgd-builder-resource-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sgd-builder-topology-inputs{grid-template-columns:repeat(3,minmax(0,1fr))}}@container command-builder (min-width: 718px){.sgd-builder-scope-panel[data-scope=base]{grid-template-columns:repeat(12,minmax(0,1fr));column-gap:16px}.sgd-builder-scope-panel[data-scope=base]>:where(.sgd-builder-recipe, .sgd-builder-section){grid-column:1/-1}.sgd-builder-scope-panel[data-scope=base]>.sgd-builder-section:nth-last-child(-n+2){grid-column:span 6}.sgd-builder-output-rail{grid-template-columns:minmax(0,1fr)}.sgd-builder-main[data-scope=base] .sgd-builder-output-rail{grid-template-columns:repeat(2,minmax(0,1fr))}.sgd-builder-choice-grid[data-density=compact]{grid-template-columns:repeat(3,minmax(0,1fr))}}@container command-builder (min-width: 958px){.sgd-builder-scope-tabs{margin-inline:20px}.sgd-builder-scope-tabs button{font-size:14px}.sgd-builder-main{display:grid;grid-template-columns:minmax(0,38fr) minmax(0,62fr)}.sgd-builder-controls{padding:8px 20px 24px;border-right:1px solid var(--sgdb-line)}.sgd-builder-output-rail{grid-template-columns:minmax(0,1fr);padding:16px}.sgd-builder-scope-panel[data-scope=base]{display:grid;grid-template-columns:minmax(0,1fr)}.sgd-builder-scope-panel[data-scope=base]>.sgd-builder-recipe,.sgd-builder-scope-panel[data-scope=base]>.sgd-builder-section,.sgd-builder-scope-panel[data-scope=base]>.sgd-builder-section:nth-last-child(-n+2){grid-column:1}.sgd-builder-hardware-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sgd-builder-output{box-shadow:0 1px 2px color-mix(in oklch,var(--sgdb-ink) 5%,transparent)}}[data-theme=dark] .sgd-command-builder,html.dark .sgd-command-builder{--sgdb-surface:oklch(24% 0.015 258);--sgdb-raised:oklch(27% 0.015 258);--sgdb-ink:oklch(94% 0.006 80);--sgdb-muted:oklch(71% 0.012 258);--sgdb-line:rgba(255, 255, 255, 0.09);--sgdb-brand:oklch(70% 0.14 40);--sgdb-serve:oklch(74% 0.11 45);--sgdb-request:oklch(77% 0.1 64);--sgdb-ok:oklch(74% 0.11 153);--sgdb-warn:oklch(76% 0.11 78);--sgdb-error:oklch(73% 0.14 25);--sgdb-well:rgba(0, 0, 0, 0.32);--sgdb-well-inset:inset 0 1px 2px rgba(0, 0, 0, 0.4);--sgdb-thumb-bg:linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));--sgdb-thumb-shadow:0 0 0 0.5px rgba(255, 255, 255, 0.16),\n inset 0 1px 0 rgba(255, 255, 255, 0.13),\n 0 2px 8px rgba(0, 0, 0, 0.35);--sgdb-pick-hover:rgba(255, 255, 255, 0.06);--sgdb-code-bg:oklch(18% 0.012 258);--sgdb-code-inset:rgba(0, 0, 0, 0.5);box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 16px 40px -16px rgba(0,0,0,.5)}@media (prefers-reduced-motion:reduce){.sgd-command-builder *,.sgd-command-builder ::after,.sgd-command-builder ::before{scroll-behavior:auto!important;transition:none!important;animation:none!important}}[data-theme=dark] .sgd-model-catalog,[data-theme=dark] .sgd-model-entry,html.dark .sgd-model-catalog,html.dark .sgd-model-entry{border-color:rgba(148,163,184,.2)}[data-theme=dark] .sgd-model-entry-meta h3,html.dark .sgd-model-entry-meta h3{color:#f1f5f9}[data-theme=dark] .sgd-model-entry .sgd-model-id code,html.dark .sgd-model-entry .sgd-model-id code{background:0 0;color:#cbd5e1}[data-theme=dark] .sgd-model-entry-note,html.dark .sgd-model-entry-note{color:#94a3b8}[data-theme=dark] .sgd-model-entry-link,html.dark .sgd-model-entry-link{color:#fb923c}[data-theme=dark] .sgd-chip,html.dark .sgd-chip{border-color:rgba(251,146,60,.3);background:rgba(251,146,60,.12);color:#fdba74}[data-theme=dark] .sgd-model-tags .sgd-chip,html.dark .sgd-model-tags .sgd-chip{border:0;background:rgba(129,140,248,.18);color:#c7d2fe}.prose b,.prose strong{font-weight:600}:not(pre)>code{background-color:rgba(0,0,0,.07);font-weight:600}[data-theme=dark] :not(pre)>code,html.dark :not(pre)>code{background-color:rgba(255,255,255,.13);font-weight:600}"}],"page":{"pagePath":"docs/developer_guide/msprobe_debugging_guide","slug":"/docs/developer_guide/msprobe_debugging_guide","pageMetadata":{"title":"MSProbe Debugging Guide","metatags":{"description":"Debugging AI model accuracy anomalies and numerical errors during inference using MSProbe in SGLang."},"description":null,"href":"/docs/developer_guide/msprobe_debugging_guide"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,blockquote:`blockquote`,code:`code`,h5:`h5`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`MSProbe is a debugging tool for AI models that diagnoses accuracy anomalies and\nnumerical errors during model training and inference. It captures and monitors intermediate data (feature maps, weights,\nactivations, layer outputs) and contextual metadata (prompts, tensor dtypes, hardware configuration), and supports\nvisual analysis to systematically trace the root cause of accuracy degradation or numerical errors (e.g., NaN/Inf,\noutput drift, mismatched predictions).`}),`\n`,_jsx(Heading,{level:`2`,id:`basic-details`,children:`Basic Details`}),`\n`,_jsx(Heading,{level:`3`,id:`background-concepts-msprobe-dumping-levels`,children:`Background Concepts: MSProbe Dumping Levels`}),`\n`,_jsx(_components.p,{children:`MSProbe supports three accuracy levels for data dumping, each for different debugging needs:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`L0`}),`: Dumps tensors/statistics at the `,_jsx(_components.strong,{children:`module level`}),` and generates `,_jsx(_components.code,{children:`construct.json`}),` (for network structure\nreconstruction in visualization). Requires passing a model/submodule handle.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`L1`}),`: Dumps tensors/statistics at the `,_jsx(_components.strong,{children:`torch API level`}),`, suitable for fine-grained API-level numerical checking.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`mix`}),`: Combines L0 + L1, ideal for scenarios that require both `,_jsx(_components.strong,{children:`graph reconstruction`}),` and `,_jsx(_components.strong,{children:`numerical comparison`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites-install-msprobe`,children:`Prerequisites: Install MSProbe`}),`\n`,_jsx(_components.p,{children:`Install MSProbe with pip:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pip`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` mindstudio-probe`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --pre`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`key-configuration-parameters`,children:`Key Configuration Parameters`}),`\n`,_jsx(_components.p,{children:`MSProbe uses a JSON configuration file for customized data dumping. All core parameters are listed in the table below,\nwith the default JSON configuration provided for reference.`}),`\n`,_jsx(Heading,{level:`4`,id:`configuration-parameter-table`,children:`Configuration Parameter Table`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`center`},children:`Field`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Description`}),_jsx(_components.th,{style:{textAlign:`center`},children:`Required`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`center`},children:_jsx(_components.code,{children:`task`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Type of dump task. Common PyTorch values include `,_jsx(_components.code,{children:`\"statistics\"`}),` and `,_jsx(_components.code,{children:`\"tensor\"`}),`. A statistics task collects tensor statistics (mean, variance, max, min, etc.) while a tensor task captures arbitrary tensors.`]}),_jsx(_components.td,{style:{textAlign:`center`},children:`Yes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`center`},children:_jsx(_components.code,{children:`dump_path`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Directory where dump results are stored. When omitted, `,_jsx(_components.code,{children:`MSProbe`}),` uses its default path.`]}),_jsx(_components.td,{style:{textAlign:`center`},children:`No`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`center`},children:_jsx(_components.code,{children:`rank`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Ranks to sample. An empty list collects every rank. For single-card tasks you must set this field to `,_jsx(_components.code,{children:`[]`}),`.`]}),_jsx(_components.td,{style:{textAlign:`center`},children:`No`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`center`},children:_jsx(_components.code,{children:`step`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Token iteration(s) to sample. An empty list means every iteration.`}),_jsx(_components.td,{style:{textAlign:`center`},children:`No`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`center`},children:_jsx(_components.code,{children:`level`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Dump level string (`,_jsx(_components.code,{children:`\"L0\"`}),`, `,_jsx(_components.code,{children:`\"L1\"`}),`, or `,_jsx(_components.code,{children:`\"mix\"`}),`). `,_jsx(_components.code,{children:`L0`}),` targets `,_jsx(_components.code,{children:`nn.Module`}),`, `,_jsx(_components.code,{children:`L1`}),` targets `,_jsx(_components.code,{children:`torch.api`}),`, and `,_jsx(_components.code,{children:`mix`}),` collects both.`]}),_jsx(_components.td,{style:{textAlign:`center`},children:`Yes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`center`},children:_jsx(_components.code,{children:`async_dump`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Whether to enable asynchronous dump (supported for PyTorch `,_jsx(_components.code,{children:`statistics`}),`/`,_jsx(_components.code,{children:`tensor`}),` tasks). Defaults to `,_jsx(_components.code,{children:`false`}),`.`]}),_jsx(_components.td,{style:{textAlign:`center`},children:`No`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`center`},children:_jsx(_components.code,{children:`scope`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Customize the scope of dump. Provide two module or API names that follow the tool’s naming convention to lock a range, only data between the two names will be dumped. An empty list dumps every module or torch API.`,_jsx(`br`,{}),_jsx(`br`,{}),`Examples:`,_jsx(`br`,{}),_jsx(_components.code,{children:`\"scope\": [\"Module.conv1.Conv2d.forward.0\", \"Module.fc2.Linear.forward.0\"]`}),_jsx(`br`,{}),_jsx(_components.code,{children:`\"scope\": [\"Tensor.add.0.forward\", \"Functional.square.2.forward\"]`}),_jsx(`br`,{}),_jsx(`br`,{}),`The `,_jsx(_components.code,{children:`level`}),` setting determines what can be provided—modules when `,_jsx(_components.code,{children:`level=L0`}),`, APIs when `,_jsx(_components.code,{children:`level=L1`}),`, and either modules or APIs when `,_jsx(_components.code,{children:`level=mix`}),`.`]}),_jsx(_components.td,{style:{textAlign:`center`},children:`No`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`center`},children:_jsx(_components.code,{children:`list`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Customize dump list, only dumps elements from the list. An empty list dumps every module or torch API. Options include:`,_jsx(`br`,{}),_jsx(`br`,{}),`•Supply the full names of specific APIs in PyTorch eager mode to only dump those APIs. Example: `,_jsx(_components.code,{children:`\"list\": [\"Tensor.permute.1.forward\", \"Tensor.transpose.2.forward\", \"Torch.relu.3.backward\"]`}),`.`,_jsx(`br`,{}),`•When `,_jsx(_components.code,{children:`level=mix`}),`, you can provide module names so that the dump expands to everything produced while the module is running. Example: `,_jsx(_components.code,{children:`\"list\": [\"Module.module.language_model.encoder.layers.0.mlp.ParallelMlp.forward.0\"]`}),`.`,_jsx(`br`,{}),`•Provide a substring such as `,_jsx(_components.code,{children:`\"list\": [\"relu\"]`}),` to dump every API whose name contains the substring. When `,_jsx(_components.code,{children:`level=mix`}),`, modules whose names contain the substring are also expanded.`]}),_jsx(_components.td,{style:{textAlign:`center`},children:`No`})]})]})]}),`\n`,_jsx(Heading,{level:`4`,id:`default-configuration`,children:`Default configuration`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`29`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`29`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"task\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"statistics\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"dump_path\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./dump_path\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"rank\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"step\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"level\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"L1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"async_dump\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"statistics\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"scope\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data_mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"all\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"summary_mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"statistics\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"tensor\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"scope\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data_mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"all\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"file_format\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"npy\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"acc_check\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"white_list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"black_list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error_data_path\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`4`,id:`outputs`,children:`Outputs`}),`\n`,_jsxs(_components.p,{children:[`Dump files are written into `,_jsx(_components.code,{children:`dump_path`}),` you defined. They usually contain:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dump.json`}),`, which records metadata such as dtype, shape, min, max, mean, L2 norm, and `,_jsx(_components.code,{children:`requires_grad`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`construct.json`}),`, hierarchical structure description, when `,_jsx(_components.code,{children:`level`}),` is `,_jsx(_components.code,{children:`L0`}),` or `,_jsx(_components.code,{children:`mix`}),` (required for visualization), its\ncontent is not empty.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`stack.json`}),`, record the call stack information of API/Module.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dump_tensor_data`}),`, generated when `,_jsx(_components.code,{children:`task`}),` is `,_jsx(_components.code,{children:`tensor`}),` and save the collected tensor data.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`#dump-directory-description`,children:`dump directory description`}),` for details.`]}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Note`}),`: When MSProbe is enabled, cuda graph is disabled (disable_cuda_graph=True) because MSProbe only supports dump\nin eager mode, warmup is disabled (skip_server_warmup=True) because there is no need to dump data for this stage.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`end-to-end-examples`,children:`End-to-End Examples`}),`\n`,_jsxs(_components.p,{children:[`MSProbe’s full debugging workflow follows `,_jsx(_components.strong,{children:`Enable → Collect Data → Visualize → Analyze Root Cause`}),`. Below is a common\nE2E example for SGLang-based model inference debugging.`]}),`\n`,_jsx(Heading,{level:`3`,id:`example--advanced-debugging-with-custom-configuration`,children:`Example : Advanced Debugging with Custom Configuration`}),`\n`,_jsxs(_components.p,{children:[`Suitable for targeted debugging (e.g., only collect statistics data for specific ranks/steps, enable mix level for graph\nreconstruction + numerical comparison) and root cause analysis via `,_jsx(_components.strong,{children:`problem vs. benchmark comparison`}),`.`]}),`\n`,_jsx(Heading,{level:`4`,id:`step-1-enable`,children:`Step 1: Enable`}),`\n`,_jsx(_components.h5,{children:`Prepare Custom Configuration JSON`}),`\n`,_jsxs(_components.p,{children:[`Create `,_jsx(_components.code,{children:`msprobe-config.json`}),` (dump statistics data for rank0/1, step0/1, mix level):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`22`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"task\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"statistics\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"dump_path\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./problem_dump\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"rank\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"step\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"level\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mix\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"async_dump\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"statistics\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"scope\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data_mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"all\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"summary_mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"statistics\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.h5,{children:`Enable MSProbe with Custom Configuration in SGLang`}),`\n`,_jsxs(_components.p,{children:[`Launch the SGLang server and specify the configuration file path with `,_jsx(_components.code,{children:`--msprobe-dump-config`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`python3`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -m`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sglang.launch_server`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --model-path`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Qwen/Qwen2.5-0.5B-Instruct`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --host`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 127.0.0.1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --port`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1027`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --msprobe-dump-config`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` /home/msprobe-config.json`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`4`,id:`step-2-collect-data`,children:`Step 2: Collect Data`}),`\n`,_jsx(_components.h5,{children:`Collect Dump Data for Problem \u0026 Benchmark Sides`}),`\n`,_jsx(_components.p,{children:`Send normal inference requests to trigger model running (MSProbe automatically collects data during request processing):`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"Qwen/Qwen2.5-0.5B-Instruct\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"Hello, my name is\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 10`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` http://127.0.0.1:1027/v1/chat/completions`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Problem side`}),`: Run the above SGLang server (with the accuracy/numerical issue) and send inference request; dump\ndata is saved to `,_jsx(_components.code,{children:`./problem_dump`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Benchmark side`}),`: Launch a normal SGLang server (without the issue, e.g., stable framework version/operator) with\nthe `,_jsx(_components.strong,{children:`same custom configuration`}),` and send the `,_jsx(_components.strong,{children:`same inference request`}),`; rename the dump directory\nto `,_jsx(_components.code,{children:`./bench_dump`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Key Requirement`}),`: Problem and benchmark dumps must use the same inputs and sampling points (rank/step)\nfor valid comparison.`]}),`\n`]}),`\n`,_jsx(_components.h5,{children:`Check Generated Dump Files`}),`\n`,_jsxs(_components.p,{children:[`Dump files are saved to `,_jsx(_components.code,{children:`./problem_dump`}),` and `,_jsx(_components.code,{children:`./bench_dump`}),` you defined and include core files for subsequent analysis:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dump.json`}),`: Records tensor metadata of APIs and modules (dtype, shape, min/max/mean, L2 norm, `,_jsx(_components.code,{children:`requires_grad`}),`, etc.).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`stack.json`}),`: Logs call stack information of APIs and modules.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`construct.json`}),`: hierarchical structure description, required for visualization, its content is not empty.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`4`,id:`step-3-visualize`,children:`Step 3: Visualize`}),`\n`,_jsx(_components.h5,{children:`Visualize Problem vs. Benchmark Comparison (Multi-Rank)`}),`\n`,_jsxs(_components.p,{children:[`Generate a multi-rank comparison visualization file (mix level generates `,_jsx(_components.code,{children:`construct.json`}),` for graph reconstruction):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`msprobe`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` graph_visualize`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -tp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./problem_dump/step0`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -gp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./bench_dump/step0`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -o`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./graph_output`})]}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`-tp`}),`: Path to problem-side dump data`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`-gp`}),`: Path to benchmark-side dump data`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`-o`}),`: Output directory for visualization files`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`If you want overflow check (for NaN/Inf detection), please specify the parameter `,_jsx(_components.code,{children:`-oc`})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`msprobe`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` graph_visualize`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -tp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./problem_dump/step0`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -gp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./bench_dump/step0`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -o`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./graph_output`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -oc`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`After the comparison or build task finishes, a `,_jsx(_components.code,{children:`compare_{timestamp}.vis.db`}),` file is created under `,_jsx(_components.code,{children:`graph_output`}),`.`]}),`\n`,_jsx(_components.p,{children:`The dumped data can be used to visualize and analyze differences using tables or charts generated with visualization tools such as Matplotlib and Excel.`}),`\n`,_jsx(_components.h5,{children:`Launch TensorBoard`}),`\n`,_jsx(_components.p,{children:`Start TensorBoard:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`tensorboard`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --logdir`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./graph_output`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --bind_all`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --port`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 6006`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`4`,id:`step-4-analyze-root-cause`,children:`Step 4: Analyze Root Cause`}),`\n`,_jsx(_components.h5,{children:`Locate Root Cause`}),`\n`,_jsx(_components.p,{children:`Root Cause Analysis in TensorBoard:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Divergent nodes (with accuracy/numerical differences) are highlighted in `,_jsx(_components.strong,{children:`red`}),` (darker red = larger difference).`]}),`\n`,_jsx(_components.li,{children:`Click on divergent nodes to view detailed tensor data (inputs/outputs, parameters) and API/module call stacks.`}),`\n`,_jsxs(_components.li,{children:[`Use the `,_jsx(_components.strong,{children:`search/filter`}),` function to quickly locate key layers/APIs (e.g., “relu”, “conv”).`]}),`\n`,_jsx(_components.li,{children:`Switch between ranks/steps via the UI to check cross-rank/cross-step divergence.`}),`\n`,_jsxs(_components.li,{children:[`Check the `,_jsx(_components.strong,{children:`overflow check`}),` tab for NaN/Inf values in specific nodes (the direct cause of numerical instability).`]}),`\n`]}),`\n`,_jsx(_components.h5,{children:`Verify the Root Cause`}),`\n`,_jsx(_components.p,{children:`After locating the divergent node (e.g., a specific Conv layer or torch API with abnormal tensor values), verify by:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Narrowing the dump scope to this node (via `,_jsx(_components.code,{children:`scope`}),`/`,_jsx(_components.code,{children:`list`}),` in the configuration file) for fine-grained data collection.`]}),`\n`,_jsx(_components.li,{children:`Modifying the problematic layer/API (e.g., replacing the operator, adjusting the dtype) and re-running the debugging\nworkflow to confirm the issue is resolved.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsx(Heading,{level:`3`,id:`no-dump-files-generated`,children:`No Dump Files Generated`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`To confirm if MSProbe is installed, use `,_jsx(_components.code,{children:`pip show mindstudio-probe`}),` to troubleshoot. If it is installed, the MSProbe\nversion information will be printed. If it is confirmed that it has not been installed, please\nuse `,_jsx(_components.code,{children:`pip install mindstudio-probe --pre`}),` for installation;`]}),`\n`,_jsxs(_components.li,{children:[`Confirm the `,_jsx(_components.code,{children:`--msprobe-dump-config`}),` parameter points to the `,_jsx(_components.strong,{children:`correct JSON file path`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`dump-files-are-too-large-excessive-data`,children:`Dump Files Are Too Large (Excessive Data)`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Start with `,_jsx(_components.code,{children:`task: \"statistics\"`}),` instead of `,_jsx(_components.code,{children:`\"tensor\"`}),` to collect only tensor statistics (avoids raw tensor dump);`]}),`\n`,_jsxs(_components.li,{children:[`Narrow the dump range with the `,_jsx(_components.code,{children:`scope`}),` field (specify start/end module/API);`]}),`\n`,_jsxs(_components.li,{children:[`Filter dump targets with the `,_jsx(_components.code,{children:`list`}),` field (only dump specific modules/APIs or substrings);`]}),`\n`,_jsxs(_components.li,{children:[`Sample specific `,_jsx(_components.code,{children:`rank`}),` and `,_jsx(_components.code,{children:`step`}),` (avoid dumping all ranks/iterations).`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`tensorboard-visualization-fails`,children:`TensorBoard Visualization Fails`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Confirm `,_jsx(_components.code,{children:`construct.json`}),` is not empty (requires `,_jsx(_components.code,{children:`level: L0`}),` or `,_jsx(_components.code,{children:`mix`}),` – L1 does not generate graph files);`]}),`\n`,_jsxs(_components.li,{children:[`Check that the `,_jsx(_components.code,{children:`-tp`}),` (problem dump) and `,_jsx(_components.code,{children:`-gp`}),` (benchmark dump) paths point to `,_jsx(_components.strong,{children:`valid rank/step subdirectories`}),` (\ne.g., `,_jsx(_components.code,{children:`step0/rank0`}),`);`]}),`\n`,_jsxs(_components.li,{children:[`Ensure the MSProbe version is up-to-date (reinstall with `,_jsx(_components.code,{children:`pip install mindstudio-probe --pre --upgrade`}),`);`]}),`\n`,_jsxs(_components.li,{children:[`Verify TensorBoard is installed and the `,_jsx(_components.code,{children:`--logdir`}),` parameter points to the directory containing `,_jsx(_components.code,{children:`.vis.db`}),` files (not\nthe file itself).`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`numerical-comparison-shows-no-divergence-but-model-accuracy-is-low`,children:`Numerical Comparison Shows No Divergence But Model Accuracy Is Low`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Expand the dump `,_jsx(_components.code,{children:`step`}),` range (check more token iterations for late-stage divergence);`]}),`\n`,_jsxs(_components.li,{children:[`Switch to `,_jsx(_components.code,{children:`task: \"tensor\"`}),` (statistics may mask subtle numerical differences in raw tensor data);`]}),`\n`,_jsxs(_components.li,{children:[`Ensure the problem and benchmark dumps use `,_jsx(_components.strong,{children:`the same input data/hardware configuration`}),` (different inputs lead to\ninvalid comparisons);`]}),`\n`,_jsxs(_components.li,{children:[`Use the `,_jsx(_components.code,{children:`manual mapping`}),` feature in TensorBoard (automatic mapping may miss some nodes for custom models).`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`appendix`,children:`Appendix`}),`\n`,_jsx(Heading,{level:`3`,id:`dump-directory-description`,children:`Dump directory description`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`29`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`29`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── problem_dump or bench_dump`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ ├── step0`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ ├── rank0`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ ├── dump_tensor_data`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ │ ├── Tensor.permute.1.forward.pt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ │ ├── Functional.linear.5.backward.output.pt # Format: {api_type}.{api_name}.{call_count}.{forward/backward}.{input/output}.{arg_index}.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ │ │ # arg_index is the nth input or output of the API. If an input is a list, keep numbering with decimals (e.g., 1.1 is the first element of the first argument).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ │ ├── Module.conv1.Conv2d.forward.0.input.0.pt # Format: {Module}.{module_name}.{class_name}.{forward/backward}.{call_count}.{input/output}.{arg_index}.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ │ ├── Module.conv1.Conv2d.forward.0.parameters.bias.pt # Module parameter data: {Module}.{module_name}.{class_name}.forward.{call_count}.parameters.{parameter_name}.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ │ └── Module.conv1.Conv2d.parameters_grad.weight.pt # Module parameter gradients: {Module}.{module_name}.{class_name}.parameters_grad.{parameter_name}. Gradients do not include call_count because the same gradient updates all invocations.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"│ │ │ │ # When the `model` argument passed to dump is a List[torch.nn.Module] or Tuple[torch.nn.Module], module-level data names also include the index inside the list ({Module}.{index}.*), e.g., Module.0.conv1.Conv2d.forward.0.input.0.pt.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ ├── dump.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ ├── stack.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ ├── dump_error_info.log`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ └── construct.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ ├── rank1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ ├── dump_tensor_data`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ │ └── ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ ├── dump.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ ├── stack.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ ├── dump_error_info.log`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │ └── construct.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ ├── ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ └── rank7`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ ├── step1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ │ ├── ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ ├── step2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`rank`}),`: Device ID. Each card writes its data to the corresponding `,_jsx(_components.code,{children:`rank{ID}`}),` directory. In non-distributed scenarios\nthe directory is simply named `,_jsx(_components.code,{children:`rank`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dump_tensor_data`}),`: Save the collected tensor data.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dump.json`}),`: Statistics for the forward data of each API or module, including names, dtype, shape, max, min, mean, L2\nnorm (square root of the L2 variance), and CRC-32 when `,_jsx(_components.code,{children:`summary_mode=\"md5\"`}),`.\nSee `,_jsx(_components.a,{href:`#dump-json-file-description`,children:`dump.json file description`}),` for details.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dump_error_info.log`}),`: Present only when the dump tool encountered an error and records the failure log.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`stack.json`}),`: Call stacks for APIs/modules.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`construct.json`}),`: Hierarchical structure description. Empty when `,_jsx(_components.code,{children:`level=L1`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`dump-json-file-description`,children:`dump.json file description`}),`\n`,_jsx(Heading,{level:`4`,id:`l0-level`,children:`L0 level`}),`\n`,_jsxs(_components.p,{children:[`An L0 `,_jsx(_components.code,{children:`dump.json`}),` contains forward/backward I/O for modules together with parameters and parameter gradients. Using\nPyTorch’s `,_jsx(_components.code,{children:`Conv2d`}),` as an example, the network code looks like:`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.code,{children:`output = self.conv2(input) # self.conv2 = torch.nn.Conv2d(64, 128, 5, padding=2, bias=True)`})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`dump.json`}),` contains the following entries:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Module.conv2.Conv2d.forward.0`}),`: Forward data of the module. `,_jsx(_components.code,{children:`input_args`}),` represents positional inputs, `,_jsx(_components.code,{children:`input_kwargs`}),`\nrepresents keyword inputs, `,_jsx(_components.code,{children:`output`}),` stores forward outputs, and `,_jsx(_components.code,{children:`parameters`}),` stores weights/biases.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Module.conv2.Conv2d.parameters_grad`}),`: Parameter gradients (weight and bias).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Module.conv2.Conv2d.backward.0`}),`: Backward data of the module. `,_jsx(_components.code,{children:`input`}),` represents gradients that flow into the\nmodule (gradients of the forward outputs) and `,_jsx(_components.code,{children:`output`}),` represents gradients that flow out (gradients of the module\ninputs).`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Note`}),`: When the `,_jsx(_components.code,{children:`model`}),` parameter passed to the dump API is `,_jsx(_components.code,{children:`List[torch.nn.Module]`}),` or `,_jsx(_components.code,{children:`Tuple[torch.nn.Module]`}),`,\nmodule-level names include the index inside the list (`,_jsx(_components.code,{children:`{Module}.{index}.*`}),`). Example: `,_jsx(_components.code,{children:`Module.0.conv1.Conv2d.forward.0`}),`.`]}),`\n`,`\n`,_jsx(Heading,{level:`4`,id:`l1-level`,children:`L1 level`}),`\n`,_jsxs(_components.p,{children:[`An L1 `,_jsx(_components.code,{children:`dump.json`}),` records forward/backward I/O for APIs. Using PyTorch’s `,_jsx(_components.code,{children:`relu`}),` function as an\nexample (`,_jsx(_components.code,{children:`output = torch.nn.functional.relu(input)`}),`), the file contains:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Functional.relu.0.forward`}),`: Forward data of the API. `,_jsx(_components.code,{children:`input_args`}),` are positional inputs, `,_jsx(_components.code,{children:`input_kwargs`}),` are keyword\ninputs, and `,_jsx(_components.code,{children:`output`}),` stores the forward outputs.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Functional.relu.0.backward`}),`: Backward data of the API. `,_jsx(_components.code,{children:`input`}),` represents the gradients of the forward outputs,\nand `,_jsx(_components.code,{children:`output`}),` represents the gradients that flow back to the forward inputs.`]}),`\n`]}),`\n`,`\n`,_jsx(Heading,{level:`4`,id:`mix-level`,children:`mix level`}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`mix`}),` dump.json contains both L0 and L1 level data; the file format is the same as the examples above.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"MSProbe Debugging Guide","metatags":{"description":"Debugging AI model accuracy anomalies and numerical errors during inference using MSProbe in SGLang."},"description":null,"href":"/docs/developer_guide/msprobe_debugging_guide"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Basic Details","slug":"basic-details","depth":2,"children":[{"title":"Background Concepts: MSProbe Dumping Levels","slug":"background-concepts-msprobe-dumping-levels","depth":3,"children":[]},{"title":"Prerequisites: Install MSProbe","slug":"prerequisites-install-msprobe","depth":3,"children":[]},{"title":"Key Configuration Parameters","slug":"key-configuration-parameters","depth":3,"children":[]},{"title":"Configuration Parameter Table","slug":"configuration-parameter-table","depth":4,"children":[]},{"title":"Default configuration","slug":"default-configuration","depth":4,"children":[]},{"title":"Outputs","slug":"outputs","depth":4,"children":[]}]},{"title":"End-to-End Examples","slug":"end-to-end-examples","depth":2,"children":[{"title":"Example : Advanced Debugging with Custom Configuration","slug":"example--advanced-debugging-with-custom-configuration","depth":3,"children":[]},{"title":"Step 1: Enable","slug":"step-1-enable","depth":4,"children":[]},{"title":"Step 2: Collect Data","slug":"step-2-collect-data","depth":4,"children":[]},{"title":"Step 3: Visualize","slug":"step-3-visualize","depth":4,"children":[]},{"title":"Step 4: Analyze Root Cause","slug":"step-4-analyze-root-cause","depth":4,"children":[]}]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[{"title":"No Dump Files Generated","slug":"no-dump-files-generated","depth":3,"children":[]},{"title":"Dump Files Are Too Large (Excessive Data)","slug":"dump-files-are-too-large-excessive-data","depth":3,"children":[]},{"title":"TensorBoard Visualization Fails","slug":"tensorboard-visualization-fails","depth":3,"children":[]},{"title":"Numerical Comparison Shows No Divergence But Model Accuracy Is Low","slug":"numerical-comparison-shows-no-divergence-but-model-accuracy-is-low","depth":3,"children":[]}]},{"title":"Appendix","slug":"appendix","depth":2,"children":[{"title":"Dump directory description","slug":"dump-directory-description","depth":3,"children":[]},{"title":"dump.json file description","slug":"dump-json-file-description","depth":3,"children":[]},{"title":"L0 level","slug":"l0-level","depth":4,"children":[]},{"title":"L1 level","slug":"l1-level","depth":4,"children":[]},{"title":"mix level","slug":"mix-level","depth":4,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"lmsysorg","siteName":"SGLang Documentation","title":"MSProbe Debugging Guide - SGLang Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-27T23:39:03.289Z","originalFileLocation":"docs/developer_guide/msprobe_debugging_guide.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"SGLang Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"MSProbe Debugging Guide - SGLang Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SGLang Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lmsysorg.mintlify.app/_mintlify/api/og/v2?division=Developer+Guide\u0026amp;title=MSProbe+Debugging+Guide\u0026amp;theme=d4ae179b26802a19fb8b2ad1\u0026amp;signature=98df2ad198914e0e5a8a99b34563f560880c0b670b16288b25f352c12ff13c54\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"MSProbe Debugging Guide - SGLang Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lmsysorg.mintlify.app/_mintlify/api/og/v2?division=Developer+Guide\u0026amp;title=MSProbe+Debugging+Guide\u0026amp;theme=d4ae179b26802a19fb8b2ad1\u0026amp;signature=98df2ad198914e0e5a8a99b34563f560880c0b670b16288b25f352c12ff13c54\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/lmsysorg/HxNR9zohmNorO5Pc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SGLang Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#d55816\">\u003cmeta data-mint-head name=\"google-site-verification\" content=\"bX3ofyYQhraIpAYf4DpyZQXZO_G4xLR_RqeBAKnJA7g\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/developer_guide/msprobe_debugging_guide.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sglang.io/#organization\",\"name\":\"SGLang Documentation\",\"url\":\"https://docs.sglang.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lmsysorg/iZdDMbLWP1BLEIzC/logo/logo.png?fit=max\u0026auto=format\u0026n=iZdDMbLWP1BLEIzC\u0026q=85\u0026s=b27d467947ee2167744cb07b69badf00\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sglang.io#website\",\"name\":\"SGLang Documentation\",\"url\":\"https://docs.sglang.io\",\"publisher\":{\"@id\":\"https://docs.sglang.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide#webpage\",\"url\":\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide\",\"name\":\"MSProbe Debugging Guide\",\"dateModified\":\"2026-10-27T23:39:03.289Z\",\"isPartOf\":{\"@id\":\"https://docs.sglang.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Developer Guide\",\"item\":\"https://docs.sglang.io/docs/developer_guide/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MSProbe Debugging Guide\",\"item\":\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide#article\",\"headline\":\"MSProbe Debugging Guide\",\"name\":\"MSProbe Debugging Guide\",\"url\":\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sglang.io/docs/developer_guide/msprobe_debugging_guide#webpage\"},\"dateModified\":\"2026-10-27T23:39:03.289Z\",\"publisher\":{\"@id\":\"https://docs.sglang.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sglang.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SGLang Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"SGLang Documentation","nav":{"global":{"anchors":[]},"tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":""}]},{"tab":"User Guide","groups":[{"group":"Basic Usage","icon":"book-open","pages":[{"title":"Basic Usage","href":"/docs/basic_usage/overview"},{"title":"Tutorial: Sending a request","href":"/docs/basic_usage/send_request"},{"group":"OpenAI-Compatible APIs","pages":[{"title":"OpenAI-Compatible APIs","href":"/docs/basic_usage/openai_api"},{"title":"OpenAI APIs - Completions","href":"/docs/basic_usage/openai_api_completions"},{"title":"OpenAI APIs - Vision","href":"/docs/basic_usage/openai_api_vision"},{"title":"OpenAI APIs - Embedding","href":"/docs/basic_usage/openai_api_embeddings"}]},{"title":"Anthropic-Compatible API","href":"/docs/basic_usage/anthropic_api"},{"title":"Ollama-Compatible API","href":"/docs/basic_usage/ollama_api"},{"title":"Offline Engine API","href":"/docs/basic_usage/offline_engine_api"},{"title":"SGLang Native APIs","href":"/docs/basic_usage/native_api"},{"title":"Sampling Parameters","href":"/docs/basic_usage/sampling_params"}]},{"group":"Advanced Features","icon":"gears","pages":[{"title":"Advanced Features","href":"/docs/advanced_features/overview"},{"title":"Server Arguments","href":"/docs/advanced_features/server_arguments"},{"title":"Session-Aware Radix Cache","href":"/docs/advanced_features/session_radix_cache"},{"title":"Radix Cache Eviction Policies","href":"/docs/advanced_features/radix_eviction_policy"},{"title":"Hyperparameter Tuning","href":"/docs/advanced_features/hyperparameter_tuning"},{"title":"Text Watermarking","href":"/docs/advanced_features/text_watermarking"},{"title":"Attention Backend","href":"/docs/advanced_features/attention_backend"},{"title":"HiSparse: Hierarchical Sparse Attention","href":"/docs/advanced_features/hisparse_guide"},{"title":"Speculative Decoding","href":"/docs/advanced_features/speculative_decoding"},{"title":"Adaptive Speculative Decoding","href":"/docs/advanced_features/adaptive_speculative_decoding"},{"title":"Structured Outputs","href":"/docs/advanced_features/structured_outputs"},{"title":"Structured Outputs For Reasoning Models","href":"/docs/advanced_features/structured_outputs_for_reasoning_models"},{"title":"Tool Parser","href":"/docs/advanced_features/tool_parser"},{"title":"Reasoning Parser","href":"/docs/advanced_features/separate_reasoning"},{"title":"Thinking Budget","href":"/docs/advanced_features/thinking_budget"},{"title":"Quantization","href":"/docs/advanced_features/quantization"},{"title":"Quantized KV Cache","href":"/docs/advanced_features/quantized_kv_cache"},{"title":"Reasoning-Aware Compression","href":"/docs/advanced_features/reasoning_aware_compression"},{"title":"DP, DPA and SGLang DP Router","href":"/docs/advanced_features/dp_dpa_smg_guide"},{"title":"Prefill Context Parallelism","href":"/docs/advanced_features/prefill_cp"},{"title":"Decode Context Parallelism","href":"/docs/advanced_features/dcp"},{"title":"Expert Parallelism","href":"/docs/advanced_features/expert_parallelism"},{"title":"Paged Experts","href":"/docs/advanced_features/paged_experts"},{"title":"Engram Tables","href":"/docs/advanced_features/engram"},{"title":"LoRA Serving","href":"/docs/advanced_features/lora"},{"title":"PD Disaggregation","href":"/docs/advanced_features/pd_disaggregation"},{"title":"EPD Disaggregation","href":"/docs/advanced_features/epd_disaggregation"},{"title":"Pipeline Parallelism for Long Context","href":"/docs/advanced_features/pipeline_parallelism"},{"group":"Hierarchical KV Caching (HiCache)","pages":[{"title":"Hierarchical KV Caching (HiCache)","href":"/docs/advanced_features/hicache"},{"title":"SGLang HiCache Best Practices","href":"/docs/advanced_features/hicache_best_practices"},{"title":"HiCache System Design and Optimization","href":"/docs/advanced_features/hicache_design"},{"title":"Runtime Attach/Detach HiCache Storage Backend (No Restart)","href":"/docs/advanced_features/hicache_storage_runtime_attach_detach"}]},{"title":"SGLang Simulator","href":"/docs/advanced_features/sglang_simulator"},{"title":"Query VLM with Offline Engine","href":"/docs/advanced_features/vlm_query"},{"title":"DP for Multi-Modal Encoder in SGLang","href":"/docs/advanced_features/dp_for_multi_modal_encoder"},{"title":"Cuda Graph for Multi-Modal Encoder in SGLang","href":"/docs/advanced_features/cuda_graph_for_multi_modal_encoder"},{"title":"Breakable CUDA Graph","href":"/docs/advanced_features/breakable_cuda_graph"},{"title":"SGLang Model Gateway","href":"/docs/advanced_features/sgl_model_gateway"},{"title":"llm-d","href":"/docs/advanced_features/llm-d"},{"title":"Deterministic Inference","href":"/docs/advanced_features/deterministic_inference"},{"title":"Observability","href":"/docs/advanced_features/observability"},{"title":"Model Loading","href":"/docs/advanced_features/model_loading"},{"title":"Loading Models from Object Storage","href":"/docs/advanced_features/object_storage"},{"title":"Checkpoint Engine Integration","href":"/docs/advanced_features/checkpoint_engine"},{"title":"SGLang for RL Systems","href":"/docs/advanced_features/sglang_for_rl"}]},{"group":"Supported Models","icon":"cubes","pages":[{"title":"Supported models","mode":"wide","href":"/docs/supported-models"},{"group":"Text Generation","pages":[{"title":"Large Language Models","href":"/docs/supported-models/generative_models"},{"title":"Multimodal Language Models","href":"/docs/supported-models/multimodal_language_models"},{"title":"Diffusion language models","href":"/docs/supported-models/diffusion_language_models"}]},{"group":"Retrieval and Ranking","pages":[{"title":"Embedding models","href":"/docs/supported-models/embedding_models"},{"title":"Rerank models","href":"/docs/supported-models/rerank_models"},{"title":"Classification Models","href":"/docs/supported-models/classify_models"}]},{"group":"Specialized Models","pages":[{"title":"Reward models","href":"/docs/supported-models/reward_models"},{"title":"Decision models","href":"/docs/supported-models/decision_models"}]},{"group":"Extending SGLang","pages":[{"title":"How to Support New Models","href":"/docs/supported-models/support_new_models"},{"title":"Transformers Fallback in SGLang","href":"/docs/supported-models/transformers_fallback"},{"title":"Use Models From ModelScope","href":"/docs/supported-models/modelscope"},{"title":"MindSpore Models","href":"/docs/supported-models/mindspore_models"}]}]},{"group":"Developer Guide","icon":"code","pages":[{"title":"Developer Guide","href":"/docs/developer_guide/overview"},{"title":"Contribution Guide","mode":"wide","href":"/docs/developer_guide/contribution_guide"},{"title":"Add an out-of-tree serve backend","href":"/docs/developer_guide/serve_backend_plugins"},{"group":"Development","pages":[{"title":"Development Guide Using Docker","sidebarTitle":"Using Docker","href":"/docs/developer_guide/development_guide_using_docker"},{"title":"Development Guide for JIT Kernels","sidebarTitle":"JIT Kernels","href":"/docs/developer_guide/development_jit_kernel_guide"},{"title":"Quantization Contribution Guide","href":"/docs/developer_guide/quantization_contribution_guide"},{"title":"Layer boundaries","href":"/docs/developer_guide/layer_boundary"}]},{"group":"Benchmarking","pages":[{"title":"Benchmark and Profiling","href":"/docs/developer_guide/benchmark_and_profiling"},{"title":"Bench Serving Guide","href":"/docs/developer_guide/bench_serving"}]},{"title":"Evaluating New Models with SGLang","description":null,"href":"/docs/developer_guide/evaluating_new_models"},{"title":"MSProbe Debugging Guide","href":"/docs/developer_guide/msprobe_debugging_guide"}]},{"group":"References","icon":"bookmark","pages":[{"title":"References","description":"FAQ, environment variables, production metrics, deployment guides, and more.","href":"/docs/references/overview"},{"title":"Troubleshooting and Frequently Asked Questions","href":"/docs/references/faq"},{"title":"Environment Variables","href":"/docs/references/environment_variables"},{"title":"Production Metrics","href":"/docs/references/production_metrics"},{"title":"Production Request Tracing","href":"/docs/references/production_request_trace"},{"group":"Deployment","pages":[{"title":"Multi-Node Deployment","href":"/docs/references/multi_node_deployment/multi_node_index"},{"title":"Multi-Node Deployment","href":"/docs/references/multi_node_deployment/multi_node"},{"title":"Deploy On Kubernetes","href":"/docs/references/multi_node_deployment/deploy_on_k8s"},{"title":"LWS Based PD Deploy","href":"/docs/references/multi_node_deployment/lws_pd/lws_pd_deploy"},{"title":"DeepSeekV32-Exp RBG Based PD Deploy","href":"/docs/references/multi_node_deployment/rbg_pd/deepseekv32_pd"},{"title":"Amazon SageMaker AI","href":"/docs/basic_usage/aws_sagemaker"}]},{"title":"Custom Chat Template","href":"/docs/references/custom_chat_template"},{"group":"Frontend Language","pages":[{"title":"Frontend Language","href":"/docs/references/frontend/frontend_index"},{"title":"SGLang Frontend Language","href":"/docs/references/frontend/frontend_tutorial"},{"title":"Choices Methods in SGLang","href":"/docs/references/frontend/choices_methods"}]},{"group":"Cookbook","pages":[{"title":"Server Arguments","href":"/cookbook/base/reference/server_arguments"}]},{"title":"Post-Training Integration","href":"/docs/references/post_training_integration"},{"title":null,"href":"/docs/references/nightly_precision_regression"}]}]},{"tab":"Hardware","pages":[{"title":"Hardware","href":"/docs/hardware-platforms/overview"}]},{"tab":"Cookbook","pages":[{"title":"Cookbook","href":"/cookbook/intro"}]},{"tab":"SGLang Diffusion","pages":[{"title":"SGLang Diffusion","href":"/docs/sglang-diffusion"}]}]},"title":"MSProbe Debugging Guide - SGLang Documentation","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":[],"chunks":[]}