{
 "schema_version": 1,
 "generated": "2026-10-24",
 "id": "deepseek-ai-deepinfer--get-repeatable-outputs-with-deterministic-sampling",
 "repo": "deepseek-ai/DeepInfer",
 "repo_url": "https://github.com/deepseek-ai/DeepInfer",
 "repo_slug": "deepseek-ai-deepinfer",
 "title": "Get repeatable model outputs for regression tests",
 "page_title": "How to get repeatable model outputs for regression tests with Deep Infer",
 "summary": "Use batch-invariant inference and a fixed seed so identical inputs give identical outputs.",
 "who": "A QA or ML engineer who needs to check whether a model change alters outputs and must rule out batch-related noise.",
 "problem": "Outputs can change with batch composition and sampling randomness, which makes before and after comparisons unreliable.",
 "outcome": "A test setup where the same input tokens and sampling parameters return the same output on every run on NVIDIA hardware.",
 "steps": [
  "Run `DEEPINFER_BATCH_INVARIANT=1 DEEPINFER_ENABLE_MTP_VARLEN=0` in the shell that runs your inference script.",
  "Pass a fixed `seq_seed` to `SamplingParams` in your script.",
  "Run the same prompts twice with the same settings and save both outputs.",
  "Compare the two saved outputs and record any difference as a failed check."
 ],
 "agent_prompt": "In the DeepInfer repo, set DEEPINFER_BATCH_INVARIANT=1 and DEEPINFER_ENABLE_MTP_VARLEN=0, pass a fixed seq_seed to SamplingParams, and run <prompt file> twice. Output a diff of the two result files. Verify that the diff is empty.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "The README says both batch-invariant inference and deterministic sampling are NVIDIA only, so this setup does not apply to Ascend.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Linux with GCC 13.0 or newer and Python 3.12",
  "NVIDIA SM100 GPU with CUDA 13, or Huawei Ascend 950 NPU with CANN 9.2",
  "Access to the deepseek-ai/DeepSeek-V4.1-Flash-1017 checkpoint on Hugging Face, or a local copy",
  "Enough disk space and memory for the checkpoint and the build"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/deepseek-ai-deepinfer/get-repeatable-outputs-with-deterministic-sampling/",
 "md": "https://dedupedai.com/use-cases/deepseek-ai-deepinfer/get-repeatable-outputs-with-deterministic-sampling/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/deepseek-ai-deepinfer--get-repeatable-outputs-with-deterministic-sampling.json",
 "api_version": "v1"
}
