<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Wirewalk Advisory</title>
  <subtitle>AI and HPC infrastructure engineering: GPU and CPU compute, Linux, data pipelines, parallel storage and low-latency networking for AI factories and research centers.</subtitle>
  <link href="https://www.wirewalk.com/feed.xml" rel="self"/>
  <link href="https://www.wirewalk.com/"/>
  <updated>2026-11-06T19:34:16-05:00</updated>
  <id>https://www.wirewalk.com/</id>
  <author><name>Lenny Shovsky</name></author>
  <entry>
    <title>NVIDIA containers under Slurm: operating Enroot and Pyxis as a supported service</title>
    <link href="https://www.wirewalk.com/writing/nvidia-enroot-pyxis-slurm-container-pipeline/"/>
    <published>2026-11-02T10:00:00-05:00</published>
    <updated>2026-11-02T10:00:00-05:00</updated>
    <id>https://www.wirewalk.com/writing/nvidia-enroot-pyxis-slurm-container-pipeline/</id>
    <summary>Build a supported NVIDIA container path around Pyxis and Enroot, immutable images, cache placement, GPU constraints and multi-node acceptance tests.</summary>
    <content type="html">&lt;p&gt;Researchers should be able to spend their GPU allocation running experiments, not importing images and repairing runtime settings. Before offering Enroot/Pyxis container execution through &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun&lt;/code&gt;, prepare image delivery, driver compatibility, device constraints and cleanup.&lt;/p&gt;

&lt;p&gt;Enroot provides the container environment, and Pyxis connects task execution to Slurm through SPANK. Maintain the pair with the host and scheduler stack so a change to one component is tested against the others.&lt;/p&gt;

&lt;p&gt;The patterns below assume an administrator-supported installation. They use generic paths and an illustrative image; they do not install software or modify a live cluster.&lt;/p&gt;

&lt;h2 id=&quot;assign-each-component-a-job&quot;&gt;Assign each component a job&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/NVIDIA/pyxis&quot;&gt;NVIDIA’s Pyxis project&lt;/a&gt; documents its Slurm integration, requirements and runtime options. &lt;a href=&quot;https://github.com/NVIDIA/enroot&quot;&gt;Enroot&lt;/a&gt; supplies the underlying unprivileged sandbox workflow. Neither replaces Slurm’s allocation policy or the host’s running kernel driver.&lt;/p&gt;

&lt;p&gt;The NVIDIA Container Toolkit is a related part of the broader GPU container ecosystem, with runtime-specific integration described in its &lt;a href=&quot;https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/arch-overview.html&quot;&gt;architecture overview&lt;/a&gt;. Do not assume every runtime uses the same configuration path just because it runs the same NVIDIA framework image.&lt;/p&gt;

&lt;p&gt;Write down who owns the host driver, GPU device constraints, Enroot configuration, Pyxis plugin and image catalog. That ownership record is essential when an upgrade changes behavior at a boundary between teams.&lt;/p&gt;

&lt;h2 id=&quot;pin-the-plugin-to-the-slurm-build&quot;&gt;Pin the plugin to the Slurm build&lt;/h2&gt;

&lt;p&gt;Pyxis documents a build compatibility requirement with the deployed Slurm release. Preserve the package build inputs and rebuild or validate the plugin as part of a Slurm upgrade, before returning compute nodes to service.&lt;/p&gt;

&lt;p&gt;Do not test only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun --help&lt;/code&gt; on a login node. Plugin availability at the client and successful initialization on compute nodes are separate observations. Use a canary allocation to verify parsing, launch and cleanup.&lt;/p&gt;

&lt;p&gt;Read Slurm’s &lt;a href=&quot;https://slurm.schedmd.com/containers.html&quot;&gt;container integration guide&lt;/a&gt; before combining SPANK-based execution with built-in OCI configuration. The guide warns about conflicts between those paths. A site should have an intentional supported execution model rather than two partially configured mechanisms competing at launch time.&lt;/p&gt;

&lt;h2 id=&quot;promote-an-image-before-a-researcher-requests-it&quot;&gt;Promote an image before a researcher requests it&lt;/h2&gt;

&lt;p&gt;Select a framework release based on its application requirements and host compatibility, not merely the newest tag. NVIDIA’s &lt;a href=&quot;https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-10.html&quot;&gt;PyTorch 24.10 release notes&lt;/a&gt; illustrate the kind of versioned record to retain: framework components, CUDA stack, driver requirements and known issues.&lt;/p&gt;

&lt;p&gt;Record the registry digest, scan or review result, license requirements, expected invocation and validation workload. If the site converts an OCI image into another artifact, record the converted artifact’s checksum too.&lt;/p&gt;

&lt;p&gt;Use an immutable approved artifact for execution. A mutable tag can point to different software between two jobs. If users need to develop interactively, separate that working environment from the artifact promoted for repeatable production runs.&lt;/p&gt;

&lt;h2 id=&quot;keep-import-traffic-out-of-the-critical-path&quot;&gt;Keep import traffic out of the critical path&lt;/h2&gt;

&lt;p&gt;A cold image import can read large layers, unpack files and consume temporary capacity. Hundreds of jobs doing that independently can overload a registry or shared filesystem before useful computation begins.&lt;/p&gt;

&lt;p&gt;Plan cache, runtime and temporary directories as separate storage concerns. Determine their ownership, quota, cleanup policy and behavior after a reboot. A node-local cache improves locality only if a missing artifact can be restored reliably and its contents remain attributable to a known image.&lt;/p&gt;

&lt;p&gt;Measure cold and warm startup independently. Test concurrent launches at the intended scale, not just one interactive session. Record registry failures and cache misses separately from application runtime. A fast warm launch does not establish that a full fleet can start after maintenance empties local caches.&lt;/p&gt;

&lt;h2 id=&quot;launch-a-bounded-gpu-acceptance-job&quot;&gt;Launch a bounded GPU acceptance job&lt;/h2&gt;

&lt;p&gt;For a site that has staged an approved SquashFS artifact, the basic shape is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Within an allocation that explicitly includes a GPU.&lt;/span&gt;
srun &lt;span class=&quot;nt&quot;&gt;--ntasks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--container-image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/project/example/images/validated-pytorch.sqsh &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--container-mounts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/project/example/input:/input:ro,/project/example/output:/output &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  python &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;import torch; print(torch.cuda.is_available()); print(torch.ones(8, device=&quot;cuda&quot;).sum().item())&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The paths and image name are illustrative. The installed Pyxis version must support the selected options and artifact format. The allocation must already request the intended GPU; a container option is not a resource request.&lt;/p&gt;

&lt;p&gt;Check the program’s output and return code. Then validate a representative application kernel, data access and output ownership. A trivial tensor operation is an initial functional test, not a performance or scientific-correctness result.&lt;/p&gt;

&lt;h2 id=&quot;reconcile-driver-libraries-and-device-identity&quot;&gt;Reconcile driver, libraries and device identity&lt;/h2&gt;

&lt;p&gt;The container does not supply the host’s loaded NVIDIA kernel module. Use NVIDIA’s &lt;a href=&quot;https://docs.nvidia.com/deploy/cuda-compatibility/minor-version-compatibility.html&quot;&gt;CUDA compatibility guidance&lt;/a&gt; and the selected framework release notes to review that boundary.&lt;/p&gt;

&lt;p&gt;Record GPU UUIDs, host driver version, container artifact and application library versions. Confirm that the requested device is usable and unallocated devices are inaccessible under the site’s supported policy. Environment variables alone are not enforcement.&lt;/p&gt;

&lt;p&gt;Test ordinary GPU jobs and CPU-only jobs through the runtime. Also test a failed launch. A partially initialized container must not leave mounts, processes or runtime directories that affect the next allocation.&lt;/p&gt;

&lt;h2 id=&quot;validate-multi-node-execution-separately&quot;&gt;Validate multi-node execution separately&lt;/h2&gt;

&lt;p&gt;A one-GPU success establishes little about MPI, PMIx, RDMA or distributed framework rendezvous. Use the site’s approved launcher and test progressively: one node, two nodes and the intended scale.&lt;/p&gt;

&lt;p&gt;Check selected communication transports and per-rank GPU assignment. Keep a native or previously validated baseline using the same node placement and message sizes. If a transport fallback is used for diagnosis, remove it before promoting the image unless the fallback is an explicit supported choice.&lt;/p&gt;

&lt;p&gt;Save cancellation and timeout results too. A distributed application can start correctly and still expose cleanup problems when one rank fails. The operational contract includes how the allocation becomes reusable after that failure.&lt;/p&gt;

&lt;h2 id=&quot;handle-writable-state-and-credentials-deliberately&quot;&gt;Handle writable state and credentials deliberately&lt;/h2&gt;

&lt;p&gt;Do not assume changes made during an interactive container session become part of the image used by future jobs. Define where package caches, temporary files, model downloads and user configuration live. Mutable writable state can undermine an otherwise pinned image.&lt;/p&gt;

&lt;p&gt;Registry credentials belong in the site’s supported credential mechanism, with permissions appropriate to the account and workload. Do not place tokens in job scripts, command-line examples or broadly readable logs. Diagnostic bundles should preserve image identity without exposing authorization material.&lt;/p&gt;

&lt;p&gt;Separate cache cleanup from job-output cleanup. Deleting a runtime cache should be recoverable; deleting research results is a different operation with a different owner and retention policy.&lt;/p&gt;

&lt;h2 id=&quot;release-the-runtime-as-a-tested-combination&quot;&gt;Release the runtime as a tested combination&lt;/h2&gt;

&lt;p&gt;Maintain a small acceptance matrix covering host image, Slurm, Pyxis, Enroot, driver, framework artifact and representative workloads. Run it on a drained canary after a relevant change, including a controlled reboot when host state is involved.&lt;/p&gt;

&lt;p&gt;Keep the rollback package and previous image references available during the rollout. If the canary fails, restore the tested combination before researchers depend on the new runtime.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/docker-apptainer-research-container-operating-models/&quot;&gt;Docker or Apptainer for research computing: compare the operating models&lt;/a&gt;, &lt;a href=&quot;/writing/slurm-cgroup-v2-gpu-isolation-validation/&quot;&gt;Advanced Slurm setup: prove CPU, memory and GPU isolation before admitting jobs&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Apptainer, MPI and RDMA: make the host–container boundary explicit</title>
    <link href="https://www.wirewalk.com/writing/apptainer-mpi-rdma-host-container-compatibility/"/>
    <published>2026-11-01T10:00:00-05:00</published>
    <updated>2026-11-01T10:00:00-05:00</updated>
    <id>https://www.wirewalk.com/writing/apptainer-mpi-rdma-host-container-compatibility/</id>
    <summary>Validate hybrid and bind MPI container models through launcher, ABI, process manager, fabric libraries and device access, then prove the intended transport at scale.</summary>
    <content type="html">&lt;p&gt;When an MPI image works on one node and fails on two, inspect the boundary between its libraries and the host launch environment. The same boundary can also let a job finish over a slower transport while leaving the intended RDMA path unused.&lt;/p&gt;

&lt;p&gt;List which side supplies MPI, the process manager, fabric userspace, kernel driver and devices. Validate that combination before expanding the test to more nodes.&lt;/p&gt;

&lt;p&gt;The examples use an already validated image and generic application paths. They are launch patterns, not a promise that arbitrary host and container MPI builds can be mixed.&lt;/p&gt;

&lt;h2 id=&quot;choose-a-documented-model&quot;&gt;Choose a documented model&lt;/h2&gt;

&lt;p&gt;Apptainer describes two common approaches in its &lt;a href=&quot;https://apptainer.org/docs/user/1.3/mpi.html&quot;&gt;MPI guide&lt;/a&gt;. In a hybrid model, MPI is present inside the container and works with the host launch environment. In a bind model, host MPI components are mounted into an image designed to use them.&lt;/p&gt;

&lt;p&gt;Choose one deliberately. The hybrid model gives the image a defined MPI userspace but requires compatibility with the launcher and process-management path. The bind model can align more closely with a site’s stack, while introducing host-library dependencies that must be exposed consistently.&lt;/p&gt;

&lt;p&gt;Neither model eliminates compatibility work. A shared library resolving successfully is only the first step. Initialization, rank launch, communicator formation, device access and termination all need evidence.&lt;/p&gt;

&lt;h2 id=&quot;build-a-dependency-map-before-mounting-libraries&quot;&gt;Build a dependency map before mounting libraries&lt;/h2&gt;

&lt;p&gt;Create a small manifest identifying the application binary, MPI implementation and version, compiler runtime, PMIx or PMI path, UCX or libfabric components where used, verbs userspace and host driver. Include GPU-aware communication if the application needs it.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Layer&lt;/th&gt;
      &lt;th&gt;Evidence to retain&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Application&lt;/td&gt;
      &lt;td&gt;Build identity and linked MPI interface&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MPI&lt;/td&gt;
      &lt;td&gt;Implementation, version and configured components&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Process manager&lt;/td&gt;
      &lt;td&gt;Supported Slurm plugin and compatible library path&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Fabric userspace&lt;/td&gt;
      &lt;td&gt;Selected provider and dependencies&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Host&lt;/td&gt;
      &lt;td&gt;Kernel, device driver, firmware and exposed devices&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Avoid binding an entire system library directory to make one missing library disappear. That can replace unrelated image dependencies and produce a container that works only by accident on one node image.&lt;/p&gt;

&lt;p&gt;A targeted bind still needs its transitive dependencies. Document them and their ownership rather than relying on whatever happens to be installed on the current test machine.&lt;/p&gt;

&lt;h2 id=&quot;verify-launcher-compatibility-separately&quot;&gt;Verify launcher compatibility separately&lt;/h2&gt;

&lt;p&gt;Use Slurm’s &lt;a href=&quot;https://slurm.schedmd.com/mpi_guide.html&quot;&gt;MPI launch guidance&lt;/a&gt; and the installed MPI implementation’s instructions. The correct PMI or PMIx plugin depends on that combination. A plugin name appearing in a help listing does not establish that the container’s client libraries can initialize against it.&lt;/p&gt;

&lt;p&gt;Start with a non-MPI step, then the MPI test. For a site that explicitly supports direct launch through PMIx:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Run within a small allocation; confirm pmix support first.&lt;/span&gt;
srun &lt;span class=&quot;nt&quot;&gt;--mpi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;list
srun &lt;span class=&quot;nt&quot;&gt;--mpi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;pmix &lt;span class=&quot;nt&quot;&gt;--ntasks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  apptainer &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;mpi-validated.sif /opt/tests/mpi_hello
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The binary and image are placeholders. This pattern assumes the site has validated that launch model. Do not treat &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--mpi=pmix&lt;/code&gt; as a universal repair for MPI startup failures.&lt;/p&gt;

&lt;p&gt;Inspect the resulting process count and rank identities. A program printing twice is not enough if both instances believe they are rank zero in a one-process world.&lt;/p&gt;

&lt;h2 id=&quot;separate-rank-startup-from-message-transfer&quot;&gt;Separate rank startup from message transfer&lt;/h2&gt;

&lt;p&gt;A minimal MPI test should report the rank, communicator size and hostname, then exchange data and verify it. Follow with a small collective test. This distinguishes independent processes starting from a functioning distributed communicator.&lt;/p&gt;

&lt;p&gt;Progress through one node and two nodes before scaling further. Keep tasks per node controlled. If a failure appears only across nodes, preserve that boundary instead of immediately testing a much larger allocation with more possible causes.&lt;/p&gt;

&lt;p&gt;Check the exit status of every test and the expected output count. Some wrappers can hide a failing rank behind a successful outer command. A clean launch and cleanup sequence is part of the compatibility contract.&lt;/p&gt;

&lt;h2 id=&quot;prove-the-selected-fabric-path&quot;&gt;Prove the selected fabric path&lt;/h2&gt;

&lt;p&gt;RDMA hardware being present on the host does not establish that the image can use it. The application needs the appropriate devices, permissions and compatible userspace libraries. Inspect the selected transport using the supported diagnostics for the installed communication stack.&lt;/p&gt;

&lt;p&gt;Compare a native baseline and container run under the same allocation, placement and message sizes. Retain latency and bandwidth results as a distribution rather than one best number. Small messages and large transfers stress different parts of the stack.&lt;/p&gt;

&lt;p&gt;A passing TCP test is a useful control. It does not prove that a desired InfiniBand or RoCE path is healthy. If a container silently falls back, record the actual transport and investigate the missing component rather than declaring the image portable on the basis of completion alone.&lt;/p&gt;

&lt;h2 id=&quot;add-gpu-aware-mpi-as-a-separate-acceptance-stage&quot;&gt;Add GPU-aware MPI as a separate acceptance stage&lt;/h2&gt;

&lt;p&gt;A CPU-buffer MPI test does not establish GPU-buffer support. Use a test designed for device memory only after host-buffer communication works. Record the MPI build’s GPU support, image CUDA userspace and host NVIDIA driver.&lt;/p&gt;

&lt;p&gt;Keep GPU assignment under Slurm control. Apptainer’s &lt;a href=&quot;https://apptainer.org/docs/user/1.3/gpu.html&quot;&gt;GPU integration&lt;/a&gt; makes devices and libraries available through supported options, but it does not decide which GPU the job is entitled to use.&lt;/p&gt;

&lt;p&gt;Distinguish successful device-buffer communication from a particular direct-transfer mechanism. A stack may stage data through host memory. Establish the path with the relevant supported diagnostics before making claims about GPUDirect behavior or performance.&lt;/p&gt;

&lt;h2 id=&quot;control-environment-and-mounts&quot;&gt;Control environment and mounts&lt;/h2&gt;

&lt;p&gt;Record the environment needed by the validated stack and remove unexplained tuning variables from the reproduction. A user’s shell may carry old provider exclusions, library paths or network-interface selections that override the intended configuration.&lt;/p&gt;

&lt;p&gt;Use explicit input and output mounts. Keep the MPI dependency mounts separate from application data mounts so failures can be attributed. Apptainer’s &lt;a href=&quot;https://apptainer.org/docs/user/1.3/bind_paths_and_mounts.html&quot;&gt;mount documentation&lt;/a&gt; explains that defaults and administrator policy also influence what appears inside the container.&lt;/p&gt;

&lt;p&gt;Do not use an increasingly broad &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LD_LIBRARY_PATH&lt;/code&gt; as the permanent integration strategy. Save the final resolution of critical libraries and ensure the same image behaves consistently on every supported node image.&lt;/p&gt;

&lt;h2 id=&quot;test-cancellation-and-upgrades&quot;&gt;Test cancellation and upgrades&lt;/h2&gt;

&lt;p&gt;Cancel a small multi-node test through the normal scheduler interface and verify that its ranks and helper processes are gone. Confirm that a subsequent allocation can use the nodes and devices normally. A container that starts correctly but leaves processes behind is not operationally ready.&lt;/p&gt;

&lt;p&gt;Repeat acceptance after changing Slurm, MPI, the container runtime, the kernel or fabric drivers. The image checksum can remain identical while the host side of the contract changes underneath it.&lt;/p&gt;

&lt;p&gt;Keep native and container results in the supported-combination table, with the tested launch command. A researcher can then choose a known configuration, and the next two-node failure has a matching baseline to compare.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/slurm-distributed-job-hangs-launch-ranks-fabric/&quot;&gt;A distributed Slurm job is running but making no progress: a debugging sequence&lt;/a&gt;, &lt;a href=&quot;/writing/nvidia-enroot-pyxis-slurm-container-pipeline/&quot;&gt;NVIDIA containers under Slurm: operating Enroot and Pyxis as a supported service&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Docker or Apptainer for research computing: compare the operating models</title>
    <link href="https://www.wirewalk.com/writing/docker-apptainer-research-container-operating-models/"/>
    <published>2026-10-31T10:00:00-04:00</published>
    <updated>2026-10-31T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/docker-apptainer-research-container-operating-models/</id>
    <summary>Choose a research container workflow by comparing identity, privilege, filesystems, image delivery, scheduler integration and reproducibility rather than image format alone.</summary>
    <content type="html">&lt;p&gt;A working Docker image is a useful starting point for moving research software onto an HPC cluster. The application may need little change, but execution needs to fit the site’s users, storage and scheduler. That is where the choice of runtime matters.&lt;/p&gt;

&lt;p&gt;Compare how the processes are owned, which host files are exposed, how limits are enforced and where images are cached. Test those behaviors along with the application, rather than choosing a runtime only because it can start the image.&lt;/p&gt;

&lt;p&gt;Docker and Apptainer can belong to the same workflow: build and validate an OCI image in a controlled environment, then execute it using the site’s supported runtime. The boundary between those stages should be explicit.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-an-image-from-a-runtime&quot;&gt;Distinguish an image from a runtime&lt;/h2&gt;

&lt;p&gt;An image is a packaged filesystem and metadata. A runtime creates an execution environment from it. Image compatibility does not guarantee identical entrypoint behavior, environment handling, user identity, networking or mount defaults.&lt;/p&gt;

&lt;p&gt;Apptainer supports workflows that consume Docker and OCI images, as described in its &lt;a href=&quot;https://apptainer.org/docs/user/1.3/docker_and_oci.html&quot;&gt;OCI guide&lt;/a&gt;. Test the application invocation after conversion rather than assuming a Docker command line can be pasted unchanged into an Apptainer job.&lt;/p&gt;

&lt;p&gt;Record both the source OCI digest and the resulting SIF checksum. They identify different artifacts. If conversion is part of the release process, preserve the tool version, options and validation results alongside them.&lt;/p&gt;

&lt;h2 id=&quot;compare-identity-and-privilege-honestly&quot;&gt;Compare identity and privilege honestly&lt;/h2&gt;

&lt;p&gt;A conventional rootful Docker daemon has substantial host authority. Granting users access to its socket is therefore an infrastructure decision, not just permission to run scientific software. Docker’s &lt;a href=&quot;https://docs.docker.com/engine/security/&quot;&gt;security documentation&lt;/a&gt; discusses that attack surface.&lt;/p&gt;

&lt;p&gt;Docker also supports &lt;a href=&quot;https://docs.docker.com/engine/security/rootless/&quot;&gt;rootless mode&lt;/a&gt;, in which the daemon and containers run without root privileges through user namespaces. It is inaccurate to say that Docker always requires a root daemon. Its suitability still depends on subordinate IDs, storage, networking, resource control and local support.&lt;/p&gt;

&lt;p&gt;Apptainer commonly fits a shared-cluster workflow in which the invoking research identity remains central. Its exact privilege path depends on installation and configuration. Do not market any container runtime as a complete boundary against hostile code merely because a job runs without an obvious root process.&lt;/p&gt;

&lt;h2 id=&quot;make-filesystem-visibility-part-of-the-interface&quot;&gt;Make filesystem visibility part of the interface&lt;/h2&gt;

&lt;p&gt;A program can succeed on a workstation because its home directory contains undeclared configuration or packages. If the same directory is exposed inside the research container, the result may still appear reproducible while depending on that hidden state.&lt;/p&gt;

&lt;p&gt;Review Apptainer’s &lt;a href=&quot;https://apptainer.org/docs/user/1.3/bind_paths_and_mounts.html&quot;&gt;bind-path defaults&lt;/a&gt; and the site’s configured additions. Explicitly declare input, output and temporary storage for the supported workflow. For a previously built image:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apptainer &lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--cleanenv&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--bind&lt;/span&gt; /project/example/input:/input:ro &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--bind&lt;/span&gt; /project/example/output:/output &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  analysis.sif /opt/application/bin/analyze /input/manifest.json /output
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These paths are illustrative and must exist with appropriate permissions. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--cleanenv&lt;/code&gt; changes environment propagation; it does not by itself remove default filesystem mounts. If the workflow requires stronger containment, select and test the relevant options separately.&lt;/p&gt;

&lt;p&gt;The application should fail clearly when required data is absent. Creating an empty host directory that happens to satisfy a mount command can turn a missing dataset into a misleading empty result.&lt;/p&gt;

&lt;h2 id=&quot;use-a-comparison-table-tied-to-site-requirements&quot;&gt;Use a comparison table tied to site requirements&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Requirement&lt;/th&gt;
      &lt;th&gt;Questions for the pilot&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;User identity&lt;/td&gt;
      &lt;td&gt;Who owns output files and how are groups applied?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Privilege&lt;/td&gt;
      &lt;td&gt;Which daemon, helper or namespace setup is required?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Scheduling&lt;/td&gt;
      &lt;td&gt;Do processes remain within the allocation?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Storage&lt;/td&gt;
      &lt;td&gt;What is mounted, cached and written locally?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Networking&lt;/td&gt;
      &lt;td&gt;Does the workload require host fabric access or service networking?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Images&lt;/td&gt;
      &lt;td&gt;Can nodes obtain a pinned artifact without per-task registry pulls?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Support&lt;/td&gt;
      &lt;td&gt;Who maintains the integration after a kernel or driver change?&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Avoid scoring one runtime as universally better. A long-lived service and a short batch analysis expose different needs. A site may reasonably standardize different execution paths for them while keeping a common image-build process.&lt;/p&gt;

&lt;h2 id=&quot;keep-image-building-away-from-expensive-job-startup&quot;&gt;Keep image building away from expensive job startup&lt;/h2&gt;

&lt;p&gt;Build once in a controlled environment, test, scan according to policy and publish an immutable reference. Do not install packages from the internet during every GPU allocation. That consumes paid research time and makes success depend on a registry, package mirror and changing dependency solver state.&lt;/p&gt;

&lt;p&gt;For Apptainer, stage the validated SIF before the main job. For Docker-based services, use the platform’s supported image distribution and cache controls. Test cold-start behavior separately from a warm-cache run.&lt;/p&gt;

&lt;p&gt;Measure how startup scales when many jobs request the same large image. A runtime that launches quickly on one node may create a registry bottleneck at cluster scale. Image delivery is a storage and network workload, not merely a packaging detail.&lt;/p&gt;

&lt;h2 id=&quot;treat-gpu-support-as-a-host-image-contract&quot;&gt;Treat GPU support as a host-image contract&lt;/h2&gt;

&lt;p&gt;A container carries application libraries, but it does not replace the running host’s NVIDIA kernel driver. Driver compatibility, device access and runtime integration still need validation. Consult the framework image’s release notes and NVIDIA’s &lt;a href=&quot;https://docs.nvidia.com/deploy/cuda-compatibility/minor-version-compatibility.html&quot;&gt;CUDA compatibility guidance&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For Apptainer’s conventional GPU path, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--nv&lt;/code&gt; exposes the required NVIDIA devices and selected host libraries as documented in its &lt;a href=&quot;https://apptainer.org/docs/user/1.3/gpu.html&quot;&gt;GPU guide&lt;/a&gt;. That establishes a runtime mechanism, not scheduler authorization. Run inside a correctly constrained GPU allocation.&lt;/p&gt;

&lt;p&gt;Test a real compute operation after checking visibility. A successful &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-smi&lt;/code&gt; proves that the management utility can communicate with the driver; it does not prove the application can load all libraries, compile kernels or execute its intended workload.&lt;/p&gt;

&lt;h2 id=&quot;preserve-the-schedulers-resource-boundary&quot;&gt;Preserve the scheduler’s resource boundary&lt;/h2&gt;

&lt;p&gt;Use the site’s supported Slurm launch path. Confirm CPU binding, memory enforcement, device constraints and cancellation behavior through the chosen runtime. The container should not create an alternate process tree that escapes the expected accounting and cleanup path.&lt;/p&gt;

&lt;p&gt;Do not launch a privileged daemon on every compute node merely to preserve a familiar workstation command. First test whether the application can execute through Apptainer, Enroot/Pyxis or another supported integration. Conversely, do not assume changing the runtime leaves an MPI or GPU application unaffected.&lt;/p&gt;

&lt;p&gt;A useful acceptance run writes a small known output, verifies its ownership, checks that only allocated hardware is usable and confirms that cancellation removes all owned processes. Save the actual result with the image identity.&lt;/p&gt;

&lt;h2 id=&quot;define-reproducibility-as-more-than-packaging&quot;&gt;Define reproducibility as more than packaging&lt;/h2&gt;

&lt;p&gt;Preserve the executable image, input version, command line, relevant environment, host driver and runtime versions, and application-level validation. Hardware differences and nondeterministic algorithms can still affect results. State what kind of reproducibility is required rather than promising bitwise identity without testing it.&lt;/p&gt;

&lt;p&gt;Publish the supported launch command with the tested image, mount rules and hardware requirements. That gives researchers a route from their working software to a scheduled job without having to rediscover the cluster integration themselves.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/apptainer-mpi-rdma-host-container-compatibility/&quot;&gt;Apptainer, MPI and RDMA: make the host–container boundary explicit&lt;/a&gt;, &lt;a href=&quot;/writing/nvidia-enroot-pyxis-slurm-container-pipeline/&quot;&gt;NVIDIA containers under Slurm: operating Enroot and Pyxis as a supported service&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Slurm and Kubernetes integration: decide who owns each resource</title>
    <link href="https://www.wirewalk.com/writing/slurm-kubernetes-integration-resource-ownership/"/>
    <published>2026-10-30T10:00:00-04:00</published>
    <updated>2026-10-30T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/slurm-kubernetes-integration-resource-ownership/</id>
    <summary>Compare separate worker pools, Slurm on Kubernetes and coordinated scheduling, then test GPU ownership, identity, storage and failure recovery before sharing capacity.</summary>
    <content type="html">&lt;p&gt;A simulation team wants multi-node batch allocations; a platform team needs notebooks, inference endpoints and services. Sharing their GPU fleet is an appealing way to use expensive capacity, provided both teams can still rely on their workloads’ placement and recovery.&lt;/p&gt;

&lt;p&gt;Decide who owns each allocation before connecting the schedulers. Slurm and Kubernetes must not independently promise the same GPU, including during cancellation, worker loss and upgrades.&lt;/p&gt;

&lt;p&gt;The designs below are hypothetical. Check the limitations of the operator and software versions being considered; support for a Slurm feature can depend on the Kubernetes environment and integration release.&lt;/p&gt;

&lt;h2 id=&quot;begin-with-the-workloads-rather-than-the-tools&quot;&gt;Begin with the workloads rather than the tools&lt;/h2&gt;

&lt;p&gt;List the workloads that genuinely need to share capacity. Include task count, GPU type, CPU and memory shape, network requirements, data locality, runtime and tolerance for interruption. A notebook that remains idle overnight has different needs from a tightly coupled simulation that must launch every rank together.&lt;/p&gt;

&lt;p&gt;Identify what the users need to preserve. Slurm users may depend on accounts, fair share, reservations, job arrays and familiar launch behavior. Kubernetes users may depend on service discovery, declarative reconciliation, deployment controllers and workload identity.&lt;/p&gt;

&lt;p&gt;Do not assume one interface must absorb the other. A shared storage platform, common image pipeline and separate worker pools can solve much of the operational duplication while keeping scheduling authority simple.&lt;/p&gt;

&lt;h2 id=&quot;compare-three-distinct-patterns&quot;&gt;Compare three distinct patterns&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Pattern&lt;/th&gt;
      &lt;th&gt;Scheduling authority&lt;/th&gt;
      &lt;th&gt;Main operational question&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Separate worker pools&lt;/td&gt;
      &lt;td&gt;Each scheduler owns a disjoint pool&lt;/td&gt;
      &lt;td&gt;How is capacity transferred safely?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Slurm hosted on Kubernetes&lt;/td&gt;
      &lt;td&gt;Kubernetes places Slurm components; Slurm places batch jobs within the supported design&lt;/td&gt;
      &lt;td&gt;How do nested resource limits and node lifecycles interact?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Coordinated scheduling&lt;/td&gt;
      &lt;td&gt;An integration coordinates selected work across systems&lt;/td&gt;
      &lt;td&gt;Who is authoritative for each allocation and release?&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;These are not equivalent deployment options. They have different failure modes and support requirements. Start with the least complex pattern that satisfies an actual workload requirement, then measure whether its limitation justifies more coordination.&lt;/p&gt;

&lt;p&gt;For separate pools, define a formal handoff if machines change roles: drain, finish work, clean state, change ownership, validate and admit. A node label alone is not evidence that old processes and device allocations have disappeared.&lt;/p&gt;

&lt;h2 id=&quot;understand-the-scope-of-slinky-components&quot;&gt;Understand the scope of Slinky components&lt;/h2&gt;

&lt;p&gt;SchedMD’s &lt;a href=&quot;https://slurm.schedmd.com/slinky.html&quot;&gt;Slinky overview&lt;/a&gt; distinguishes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;slurm-operator&lt;/code&gt;, which runs Slurm on Kubernetes, from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;slurm-bridge&lt;/code&gt;, which connects selected Kubernetes scheduling to Slurm. Review those projects separately rather than treating the Slinky name as a single behavior guarantee.&lt;/p&gt;

&lt;p&gt;Pin the supported combination of Slurm, Kubernetes, operator or bridge, container runtime and host OS. Read its release-specific limitations and upgrade instructions before a pilot. The architecture should not depend on a feature seen only in a newer demonstration or an unreleased branch.&lt;/p&gt;

&lt;p&gt;Write down which workloads are in scope for coordination and which remain outside it. A bridge handling selected pods does not automatically make every Kubernetes controller, resource type or scheduling policy compatible with Slurm accounting.&lt;/p&gt;

&lt;h2 id=&quot;draw-the-resource-ownership-boundary&quot;&gt;Draw the resource-ownership boundary&lt;/h2&gt;

&lt;p&gt;For each GPU, CPU set and memory budget, identify the authority that can grant it and the mechanism that prevents another grant. Include the host’s own services and any management pods. Capacity consumed below the Slurm boundary must not also be advertised as available to jobs.&lt;/p&gt;

&lt;p&gt;Nested limits matter. If a Slurm worker runs inside a pod with a memory limit, all of its child workloads must fit the effective parent constraint. A job request can appear valid to Slurm and still exceed the outer boundary. Inspect the supported cgroup delegation design rather than assuming privileged execution fixes it.&lt;/p&gt;

&lt;p&gt;Kubernetes &lt;a href=&quot;https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/&quot;&gt;Topology Manager&lt;/a&gt; provides policies for aligning topology hints from participating resource managers. It is another placement consideration, not a substitute for a single ownership model. Validate CPU, GPU and NIC locality on the actual supported stack.&lt;/p&gt;

&lt;h2 id=&quot;assign-driver-and-device-management-once&quot;&gt;Assign driver and device management once&lt;/h2&gt;

&lt;p&gt;NVIDIA’s &lt;a href=&quot;https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/overview.html&quot;&gt;GPU Operator&lt;/a&gt; manages GPU software components in Kubernetes deployments. A cluster image may already manage some of those components. Decide which mechanism owns each layer before installing both.&lt;/p&gt;

&lt;p&gt;The ownership record should cover the kernel driver, container integration, device advertisement, monitoring and any partitioning configuration. If the driver is supplied by the host image, configure the operator according to that supported model. Avoid two reconcilers repeatedly replacing one another’s state.&lt;/p&gt;

&lt;p&gt;Test device identity by UUID across both interfaces. An allocated GPU must remain attributable to its job or pod, and a cancellation must release the resource only after the supported cleanup completes. A device being listed in both systems is not proof that ownership is coordinated.&lt;/p&gt;

&lt;h2 id=&quot;map-people-projects-and-data-access&quot;&gt;Map people, projects and data access&lt;/h2&gt;

&lt;p&gt;A Kubernetes service account and a Unix UID describe different identities. A pod creating a Slurm job needs a controlled mapping to the user, project and account that will own the work. A shared privileged submission identity can destroy the accountability the organization expected Slurm to provide.&lt;/p&gt;

&lt;p&gt;Define how cancellation, quotas and audit events follow that mapping. Preserve a stable link between the originating request, pod identity, Slurm job ID and resulting data. Restrict impersonation and administrative actions to the required integration components.&lt;/p&gt;

&lt;p&gt;Storage access needs the same care. Test numeric ownership, supplementary groups, ACL behavior, credentials and read-only mounts. A workload writing files successfully is not sufficient if those files later belong to an identity the research team cannot use.&lt;/p&gt;

&lt;h2 id=&quot;design-recovery-before-increasing-scale&quot;&gt;Design recovery before increasing scale&lt;/h2&gt;

&lt;p&gt;Use a pilot with a small set of noncritical resources. Exercise worker loss, controller restart, an unavailable API, pod eviction and cancellation during startup. Ask which system retains ownership while the other is unreachable.&lt;/p&gt;

&lt;p&gt;An uncertain allocation should not be made available twice. Conversely, an abandoned allocation should eventually be reconciled and released under a documented procedure. Record how the integration distinguishes those cases and what an operator must inspect before intervening.&lt;/p&gt;

&lt;p&gt;For long-running inference or notebook workloads, test how termination is communicated. For multi-node jobs, test partial placement and a worker disappearing after peers have started. Workload-level readiness and meaningful recovery are more demanding than a controller reporting that all desired pods exist.&lt;/p&gt;

&lt;h2 id=&quot;measure-useful-capacity-rather-than-shared-visibility&quot;&gt;Measure useful capacity rather than shared visibility&lt;/h2&gt;

&lt;p&gt;Define success using completed research work and service objectives. Compare queue wait, job completion time, startup overhead, failed allocations, service latency and operator effort. A dashboard showing more busy GPUs can conceal slower jobs and harder incident recovery.&lt;/p&gt;

&lt;p&gt;Include a rollback path that restores exclusive ownership to separate pools. Retain the original image and scheduling definitions, and verify cleanup before moving machines back. The ability to reverse a pilot is part of its design.&lt;/p&gt;

&lt;p&gt;Before sharing the fleet, demonstrate allocation and release while one control system is unavailable. If ownership cannot be reconciled safely, keep the worker pools separate until a supported coordination path is ready.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/docker-apptainer-research-container-operating-models/&quot;&gt;Docker or Apptainer for research computing: compare the operating models&lt;/a&gt;, &lt;a href=&quot;/writing/slurm-cgroup-v2-gpu-isolation-validation/&quot;&gt;Advanced Slurm setup: prove CPU, memory and GPU isolation before admitting jobs&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>A distributed Slurm job is running but making no progress: a debugging sequence</title>
    <link href="https://www.wirewalk.com/writing/slurm-distributed-job-hangs-launch-ranks-fabric/"/>
    <published>2026-10-29T10:00:00-04:00</published>
    <updated>2026-10-29T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/slurm-distributed-job-hangs-launch-ranks-fabric/</id>
    <summary>Separate allocation, process launch, rendezvous, communication and application progress when a distributed MPI or NVIDIA GPU workload appears to hang.</summary>
    <content type="html">&lt;p&gt;GPUs are allocated and processes are alive, but the distributed job has stopped printing progress. Before trying another MPI or NCCL setting, find out how far each rank got. One missing worker can leave all the others waiting.&lt;/p&gt;

&lt;p&gt;Check task launch, process-manager initialization, rendezvous, transport setup and the first collective in order. The last completed stage narrows the investigation without changing several parts of the stack at once.&lt;/p&gt;

&lt;p&gt;This sequence applies to generic Slurm-managed MPI and NVIDIA GPU workloads. The exact launcher and diagnostics depend on the installed MPI, PMIx, framework and NCCL versions. All job IDs and node descriptions are illustrative.&lt;/p&gt;

&lt;h2 id=&quot;define-progress-in-application-terms&quot;&gt;Define progress in application terms&lt;/h2&gt;

&lt;p&gt;Ask what the workload should have completed by now: initialization of all ranks, reading a first input shard, a simulation timestep, a training iteration or a checkpoint. A process consuming CPU is not necessarily making useful progress. It may be polling while another process waits on storage.&lt;/p&gt;

&lt;p&gt;Capture the job ID, allocated nodes, start time, task layout, image digest and launch command. Keep the original logs before adding diagnostics. Record whether output is buffered and whether a progress line is printed only by rank zero.&lt;/p&gt;

&lt;p&gt;If only one process writes progress, a silent log cannot distinguish a healthy long-running operation from a lost worker. Add bounded per-rank startup records in the next reproduction rather than assuming every rank reached the same point.&lt;/p&gt;

&lt;h2 id=&quot;prove-the-launch-layer-first&quot;&gt;Prove the launch layer first&lt;/h2&gt;

&lt;p&gt;Within a small allocation, run a hostname step using the intended task layout:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;srun &lt;span class=&quot;nt&quot;&gt;--ntasks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4 &lt;span class=&quot;nt&quot;&gt;--label&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;hostname
&lt;/span&gt;srun &lt;span class=&quot;nt&quot;&gt;--mpi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The first command tests basic task placement and launch. It does not test MPI. The second reports available Slurm MPI plugins; it does not prove compatibility with the application image.&lt;/p&gt;

&lt;p&gt;Use the &lt;a href=&quot;https://slurm.schedmd.com/mpi_guide.html&quot;&gt;Slurm MPI guide&lt;/a&gt; to choose the supported launch model. Avoid wrapping one launcher inside another without understanding the process tree. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun mpirun ...&lt;/code&gt; can create multiple launchers if every Slurm task executes the command, multiplying ranks and confusing failure reports.&lt;/p&gt;

&lt;p&gt;Do not repair a launch problem by allowing arbitrary SSH fanout. That may start processes outside the accounting, binding or cleanup path the site intended to enforce.&lt;/p&gt;

&lt;h2 id=&quot;establish-every-ranks-identity&quot;&gt;Establish every rank’s identity&lt;/h2&gt;

&lt;p&gt;For the reproduction, emit hostname, process ID, rank, local rank and intended world size once per process. Use the rank variables defined by that launch model. Slurm task IDs and framework ranks may coincide in one configuration and differ in another.&lt;/p&gt;

&lt;p&gt;Verify that every expected rank appears exactly once. Check that each GPU worker is assigned the intended device and that no local rank accidentally selects an unallocated GPU. Compare GPU UUIDs rather than assuming visible index zero identifies the same physical device everywhere.&lt;/p&gt;

&lt;p&gt;A missing rank is a launch or early-exit investigation. Duplicate ranks suggest a topology or launcher error. A complete, consistent rank set allows the next test to focus on initialization and communication rather than task creation.&lt;/p&gt;

&lt;h2 id=&quot;separate-rendezvous-from-the-data-path&quot;&gt;Separate rendezvous from the data path&lt;/h2&gt;

&lt;p&gt;Distributed frameworks may use a TCP rendezvous endpoint before using another transport for bulk collectives. A reachable rendezvous port therefore does not establish a working RDMA path. Equally, healthy RDMA hardware cannot compensate for ranks resolving different rendezvous addresses.&lt;/p&gt;

&lt;p&gt;Record the selected rendezvous name, resolved address, port, world size and per-process rank assignment. Check address resolution from each participating node using the same environment as the workload. Avoid selecting the first interface returned by a hostname command on a multihomed machine.&lt;/p&gt;

&lt;p&gt;If the endpoint is chosen dynamically, confirm that every rank receives the same value and that another job is not using it. Keep credentials and tokens out of the diagnostic log. A minimal initialization-only application is more useful here than immediately loading a large model and dataset.&lt;/p&gt;

&lt;h2 id=&quot;read-all-ranks-before-blaming-the-collective&quot;&gt;Read all ranks before blaming the collective&lt;/h2&gt;

&lt;p&gt;A collective can wait because one participant never reached it. Search every rank’s log for the earliest exception, input error, GPU memory failure or process termination. A rank still running can be waiting for a peer that exited minutes earlier.&lt;/p&gt;

&lt;p&gt;Use Slurm’s &lt;a href=&quot;https://slurm.schedmd.com/sacct.html&quot;&gt;step accounting&lt;/a&gt; and application logs together. A process exiting nonzero may be the cause, while communication errors elsewhere are consequences. Retain exact timestamps and avoid interpreting merged output order as an exact distributed timeline.&lt;/p&gt;

&lt;p&gt;For a small reproduction, configure a finite application timeout and an expected failure response. Do not leave diagnostic allocations indefinitely occupying GPUs because the test has no deadline.&lt;/p&gt;

&lt;h2 id=&quot;narrow-the-communication-boundary&quot;&gt;Narrow the communication boundary&lt;/h2&gt;

&lt;p&gt;Progress from one process to multiple processes on one node, then two nodes, then the intended scale. Keep the executable, image and message sizes consistent where possible. The transition that introduces the failure is evidence.&lt;/p&gt;

&lt;p&gt;For NVIDIA collectives, a bounded diagnostic environment can include:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NCCL_DEBUG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;INFO
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NCCL_DEBUG_FILE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;nccl.%h.%p.log&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These variables are documented in the &lt;a href=&quot;https://docs.nvidia.com/deeplearning/nccl/archives/nccl_2243/user-guide/docs/env.html&quot;&gt;NCCL environment reference&lt;/a&gt;. Use a job-specific output directory on a writable filesystem. Large debug logs can themselves create an I/O problem; retain them for the reproduction rather than enabling verbose logging indefinitely for all jobs.&lt;/p&gt;

&lt;p&gt;Read which transports and interfaces were selected. Do not infer RDMA use merely because InfiniBand is installed. Compare container and host visibility of network devices and required libraries, and examine the site’s approved low-level communication tests before changing application tuning.&lt;/p&gt;

&lt;h2 id=&quot;use-fallback-as-an-experiment&quot;&gt;Use fallback as an experiment&lt;/h2&gt;

&lt;p&gt;Temporarily selecting a different supported transport can help isolate a fault. If a small job works with a TCP path and fails with RDMA, the difference narrows the investigation. It does not prove a particular cable, library or driver is defective.&lt;/p&gt;

&lt;p&gt;Record the exact setting, its scope and how it is removed. A diagnostic fallback should not quietly become the production default because the run finally completed. That can leave expensive hardware unused while the infrastructure appears repaired.&lt;/p&gt;

&lt;p&gt;The same discipline applies to network-interface exclusions, shared-memory settings and GPU peer-to-peer controls. Each knob should test a hypothesis. Changing several at once produces a result that is difficult to explain and harder to maintain.&lt;/p&gt;

&lt;h2 id=&quot;check-storage-and-cpu-pressure-before-declaring-a-network-hang&quot;&gt;Check storage and CPU pressure before declaring a network hang&lt;/h2&gt;

&lt;p&gt;One rank waiting for an input shard can hold every other rank at a collective. Compare per-rank input progress, storage latency, CPU binding and data-loader activity. High GPU utilization can also include waiting or communication behavior that does not advance the scientific workload.&lt;/p&gt;

&lt;p&gt;Look for oversubscribed CPU workers, constrained memory, full temporary storage and a single slow input partition. Use a synthetic in-memory workload to separate compute/communication from the input pipeline, then restore representative I/O.&lt;/p&gt;

&lt;p&gt;For MPI, check whether the application makes the progress calls expected by its communication pattern. An application-level deadlock and a transport failure can look similar from the scheduler. A small, instrumented reproducer helps the application team and infrastructure team work on the same evidence.&lt;/p&gt;

&lt;h2 id=&quot;close-at-the-scale-that-mattered&quot;&gt;Close at the scale that mattered&lt;/h2&gt;

&lt;p&gt;A two-node success does not establish a full allocation is healthy. After fixing the isolated fault, rerun at the scale and placement that exposed it, with representative input and an explicit completion condition.&lt;/p&gt;

&lt;p&gt;Save the launch model, versions, selected interfaces, task mapping, elapsed initialization time and application outcome. Confirm every intended participant joined, communication used the expected path and the workload resumed measurable progress.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/apptainer-mpi-rdma-host-container-compatibility/&quot;&gt;Apptainer, MPI and RDMA: make the host–container boundary explicit&lt;/a&gt;, &lt;a href=&quot;/writing/mpi-troubleshooting-playbook/&quot;&gt;An MPI troubleshooting playbook: symptom to cause&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Advanced Slurm job troubleshooting: memory, exit codes and missing evidence</title>
    <link href="https://www.wirewalk.com/writing/slurm-job-failure-memory-exit-code-debugging/"/>
    <published>2026-10-28T10:00:00-04:00</published>
    <updated>2026-10-28T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/slurm-job-failure-memory-exit-code-debugging/</id>
    <summary>Reconstruct a failed job across allocation and step records, application output, cgroup limits and node events, then design a small reproduction that distinguishes causes.</summary>
    <content type="html">&lt;p&gt;After a Slurm job fails, find the earliest error before increasing its memory and trying again. A worker exception, a memory kill, stalled storage and a wrapper that hid the return code can all leave similar scheduler records.&lt;/p&gt;

&lt;p&gt;Preserve the failed run’s output, step records and node list. A larger-memory retry may succeed because the limit helped, because the input changed or because it ran on a different node. A small controlled reproduction can tell those possibilities apart.&lt;/p&gt;

&lt;p&gt;The commands here use an illustrative job ID. They do not assume that a particular accounting field is populated on every cluster.&lt;/p&gt;

&lt;h2 id=&quot;read-the-allocation-and-its-steps&quot;&gt;Read the allocation and its steps&lt;/h2&gt;

&lt;p&gt;Retrieve the parent job and child steps together:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;job&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;123456
sacct &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$job&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--units&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;M &lt;span class=&quot;nt&quot;&gt;--parsable2&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;JobID,JobName,State,ExitCode,DerivedExitCode,Elapsed,NodeList,ReqMem,MaxRSS,MaxRSSNode,MaxRSSTask
scontrol show job &lt;span class=&quot;nt&quot;&gt;-dd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$job&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The controller may no longer retain an old job, while accounting still does. Record when each query was made. Avoid using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct -X&lt;/code&gt; for the first diagnosis because hiding step records removes evidence about where the failure occurred.&lt;/p&gt;

&lt;p&gt;Interpret an exit code alongside the command that produced it. Slurm reports exit and signal information, but a shell wrapper can convert a failed inner command into an apparently successful batch result. &lt;a href=&quot;https://slurm.schedmd.com/sacct.html&quot;&gt;The sacct reference&lt;/a&gt; describes the job/step records and fields; it also notes that available statistics depend on the underlying collection mechanism.&lt;/p&gt;

&lt;h2 id=&quot;find-the-earliest-meaningful-failure&quot;&gt;Find the earliest meaningful failure&lt;/h2&gt;

&lt;p&gt;Build a short timeline from standard error, application logs, scheduler records and node events. Keep time zones explicit. The last line in a log often describes a consequence: another rank disappeared, a socket closed or a cleanup handler failed.&lt;/p&gt;

&lt;p&gt;If the application reports a missing input before the MPI launcher reports lost ranks, investigate the missing input first. If the kernel records a memory kill before the application prints communication errors, those later errors may be secondary.&lt;/p&gt;

&lt;p&gt;Preserve the submitted script, environment manifest, image digest, input version and node list. Record whether output was written per rank or merged. Buffered output can arrive late, so textual order across files is not an exact clock. Use application timestamps and system evidence where available.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-the-three-memory-budgets&quot;&gt;Distinguish the three memory budgets&lt;/h2&gt;

&lt;p&gt;A GPU job commonly has at least three relevant memory domains: host RAM, GPU device memory and shared-memory or temporary-file capacity. An application can exhaust one while dashboards show free space in another.&lt;/p&gt;

&lt;p&gt;A CUDA out-of-memory exception is not automatically a Slurm host-memory violation. A host cgroup limit can terminate a worker even when the GPU still has free memory. A data-loading subprocess can fail because a memory-backed filesystem is full while neither of those limits has been reached.&lt;/p&gt;

&lt;p&gt;Write down which component allocated memory and which limit rejected it. Then compare that domain with the resource request. Increasing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--mem&lt;/code&gt; does not increase physical GPU memory. Reducing GPU batch size may not fix an input pipeline that duplicates a large dataset into every CPU worker.&lt;/p&gt;

&lt;h2 id=&quot;interpret-maxrss-with-its-collection-method&quot;&gt;Interpret MaxRSS with its collection method&lt;/h2&gt;

&lt;p&gt;Do not compare a memory request directly with one unexplained MaxRSS number and declare the case solved. Examine the step, node and task associated with the value. A maximum is not necessarily the simultaneous total of every worker.&lt;/p&gt;

&lt;p&gt;For cgroup v2, Slurm documents differences between cgroup memory accounting and process RSS, including cache treatment and unavailable virtual-memory metrics. Check the installed release’s &lt;a href=&quot;https://slurm.schedmd.com/cgroup_v2.html&quot;&gt;cgroup v2 limitations&lt;/a&gt;. Sampling and configuration can affect whether brief peaks appear.&lt;/p&gt;

&lt;p&gt;During a reproduction, use running-step data where supported:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sstat &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 123456 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;JobID,AveRSS,MaxRSS,MaxRSSNode,MaxRSSTask
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://slurm.schedmd.com/sstat.html&quot;&gt;The sstat documentation&lt;/a&gt; requires operational job-accounting collection. Missing values are a visibility limitation, not evidence that memory usage was zero.&lt;/p&gt;

&lt;h2 id=&quot;correlate-kernel-and-cgroup-evidence&quot;&gt;Correlate kernel and cgroup evidence&lt;/h2&gt;

&lt;p&gt;An administrator should inspect a bounded time window on the affected node and the relevant job cgroup. The path must be discovered from the running process; do not hard-code a hierarchy copied from another Slurm version.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Run with appropriate visibility on the affected node.&lt;/span&gt;
journalctl &lt;span class=&quot;nt&quot;&gt;-k&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--since&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;2026-10-28 09:00:00&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--until&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;2026-10-28 09:15:00&apos;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/12345/cgroup
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here both the time window and PID are placeholders. For an identified cgroup v2 path, inspect its memory limit and event counters according to the &lt;a href=&quot;https://www.kernel.org/doc/html/v6.12/admin-guide/cgroup-v2.html&quot;&gt;kernel memory-controller documentation&lt;/a&gt;. Compare counter changes over the reproduction, not an unexplained lifetime total.&lt;/p&gt;

&lt;p&gt;Distinguish a constrained workload reaching its limit from the whole node exhausting memory. The latter also calls for investigation of advertised memory, operating-system headroom, untracked processes and node services. Increasing one job’s limit can make a node-wide problem worse.&lt;/p&gt;

&lt;h2 id=&quot;make-the-wrapper-preserve-failure&quot;&gt;Make the wrapper preserve failure&lt;/h2&gt;

&lt;p&gt;A batch script should report the outcome of the actual application. For a simple single-step job:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --job-name=bounded-reproduction&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --ntasks=1&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --cpus-per-task=4&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --mem=8G&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --time=00:10:00&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-euo&lt;/span&gt; pipefail
srun ./reproduce-case
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is a template requiring a real reviewed program. More complex workflows need deliberate handling of expected nonzero exits, pipelines, background workers and cleanup. A successful final &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;echo&lt;/code&gt; must not erase the application’s failure. Conversely, a cleanup error should not hide the original cause.&lt;/p&gt;

&lt;p&gt;When several steps run concurrently, explicitly wait for each and record their statuses. Capturing only the last background process leaves failures invisible. Shell strict mode helps with some mistakes, but it is not a substitute for designing the workflow’s success conditions.&lt;/p&gt;

&lt;h2 id=&quot;reduce-the-reproduction-along-useful-dimensions&quot;&gt;Reduce the reproduction along useful dimensions&lt;/h2&gt;

&lt;p&gt;Hold the input and software identity constant, then reduce scale. Try one task, one node and a small representative input before repeating the full job. If the failure requires concurrency, increase that dimension in controlled steps.&lt;/p&gt;

&lt;p&gt;For suspected memory growth, compare progress against consumption. A stable peak tied to batch size suggests a different remedy from memory that grows with every iteration. For irregular data, retain the exact failing sample or partition if policy permits it. A synthetic small input that omits the difficult case may produce a misleading clean run.&lt;/p&gt;

&lt;p&gt;Only change one suspected cause per experiment. Save a small matrix of input, task count, thread count, memory request, node and outcome. That makes a successful run interpretable rather than merely fortunate.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-scientific-result-as-well-as-the-process&quot;&gt;Verify the scientific result as well as the process&lt;/h2&gt;

&lt;p&gt;A zero exit status is necessary for many workflows but insufficient for research correctness. Check output count, expected dimensions, checksums or application invariants. Partial outputs from an interrupted run can make a retry appear complete when some work was skipped.&lt;/p&gt;

&lt;p&gt;Give the researcher the first failure found, the change made and the result of the reproduction. If only a workaround is known, say what it changes and what remains unexplained, so the next run does not begin with a false diagnosis.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/slurm-distributed-job-hangs-launch-ranks-fabric/&quot;&gt;A distributed Slurm job is running but making no progress: a debugging sequence&lt;/a&gt;, &lt;a href=&quot;/writing/slurm-node-local-scratch-staging-result-publication/&quot;&gt;Node-local scratch under Slurm: stage data without losing the result&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Why a Slurm job stays pending when nodes look idle</title>
    <link href="https://www.wirewalk.com/writing/slurm-pending-jobs-priority-backfill-qos/"/>
    <published>2026-10-27T10:00:00-04:00</published>
    <updated>2026-10-27T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/slurm-pending-jobs-priority-backfill-qos/</id>
    <summary>Trace a pending Slurm job through resource shape, association limits, priority, reservations and backfill without changing cluster policy to repair one submission.</summary>
    <content type="html">&lt;p&gt;“Why is my job waiting when these nodes are idle?” is a fair question. The free machines may lack the requested GPU type, sit in another partition or reservation, or offer too short a gap before higher-priority work. Show the researcher the constraint that applies to their request.&lt;/p&gt;

&lt;p&gt;Save the original submission before canceling or resubmitting. Its effective request and scheduling history help distinguish a placement problem from a limit or priority decision.&lt;/p&gt;

&lt;p&gt;All identifiers in these examples are illustrative. Commands inspect state; administrative changes require a separate decision about whose workload and policy they affect.&lt;/p&gt;

&lt;h2 id=&quot;capture-a-complete-request&quot;&gt;Capture a complete request&lt;/h2&gt;

&lt;p&gt;Start with a job ID and a timestamp. Ask for the exact script, submission command and any wrapper that generated them. The script alone can differ from the effective request because command-line options and environment variables may alter submission behavior.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;job&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;123456
scontrol show job &lt;span class=&quot;nt&quot;&gt;-dd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$job&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
squeue &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$job&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;%.18i %.9P %.20j %.8u %.2t %.10M %.6D %R&apos;&lt;/span&gt;
sinfo &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Record requested nodes, tasks, CPUs per task, memory, GPUs, features, partition, account, QOS, time limit, dependencies and reservations. A job asking for four GPUs on one node has a different feasible set from a job asking for four GPUs across four nodes.&lt;/p&gt;

&lt;p&gt;Distinguish what the application needs from what the wrapper requests. Old templates often retain an exclusive-node request, a narrow node list or a feature constraint long after the original reason has disappeared.&lt;/p&gt;

&lt;h2 id=&quot;treat-the-reason-code-as-a-lead&quot;&gt;Treat the reason code as a lead&lt;/h2&gt;

&lt;p&gt;Slurm can encounter multiple reasons that prevent a job from starting while displaying only the reason encountered by the scheduling method. The &lt;a href=&quot;https://slurm.schedmd.com/job_reason_codes.html&quot;&gt;reason-code reference&lt;/a&gt; makes this limitation explicit.&lt;/p&gt;

&lt;p&gt;A reason of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Priority&lt;/code&gt; does not prove that every requested resource would otherwise be available. A reason of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Resources&lt;/code&gt; does not identify which resource is missing. A dependency reason should lead to the upstream job and its state, rather than a search for unused CPUs.&lt;/p&gt;

&lt;p&gt;Save more than one observation over a reasonable interval if the state is changing. Do not poll the controller several times a second. A small set of time-stamped snapshots is usually more useful than a large, noisy stream that cannot be correlated with scheduling cycles.&lt;/p&gt;

&lt;h2 id=&quot;build-a-resource-shape-table&quot;&gt;Build a resource-shape table&lt;/h2&gt;

&lt;p&gt;For a generic GPU job, compare the request with the eligible nodes:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Dimension&lt;/th&gt;
      &lt;th&gt;Question to answer&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Partition&lt;/td&gt;
      &lt;td&gt;Is the node in a partition the job may use?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;CPU and memory&lt;/td&gt;
      &lt;td&gt;Can both fit on the same eligible node?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GPU&lt;/td&gt;
      &lt;td&gt;Do count, type and sharing mode match?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Features&lt;/td&gt;
      &lt;td&gt;Does the node satisfy the full constraint expression?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Time&lt;/td&gt;
      &lt;td&gt;Is there a long enough usable interval?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;State&lt;/td&gt;
      &lt;td&gt;Is the node available, drained, reserved or completing work?&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Eight unused GPUs spread over eight hosts cannot satisfy a single-node request for eight GPUs. Likewise, idle cores do not help if another allocation has consumed the node’s schedulable memory. Aggregate dashboards hide these combinations.&lt;/p&gt;

&lt;p&gt;Use controller-visible resources for the first comparison. A host’s physical inventory can differ from what the scheduler advertises. If those disagree, investigate registration and configuration as a separate fault rather than changing the user’s request to conceal it.&lt;/p&gt;

&lt;h2 id=&quot;follow-account-and-qos-limits&quot;&gt;Follow account and QOS limits&lt;/h2&gt;

&lt;p&gt;A user may belong to the right project and still hit an aggregate limit because other jobs in that association are consuming the allowance. Per-job limits and aggregate limits require different remedies.&lt;/p&gt;

&lt;p&gt;For an administrator with suitable visibility:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sacctmgr show assoc where &lt;span class=&quot;nv&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;researcher
sacctmgr show qos
scontrol show partition research
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These names are placeholders. Interpret inheritance, partition-specific associations and configured enforcement using the installed &lt;a href=&quot;https://slurm.schedmd.com/resource_limits.html&quot;&gt;resource-limits guide&lt;/a&gt;. Do not assume an empty field means unlimited at every level.&lt;/p&gt;

&lt;p&gt;Compare the pending job with running jobs charged to the same account and QOS. If an aggregate GPU allowance is exhausted, reducing an unrelated CPU request will not help. If the request exceeds a maximum time limit, waiting longer will not make it eligible.&lt;/p&gt;

&lt;p&gt;A useful support response names the exact limit, its scope and the next event that would free capacity. Changing QOS globally to start one job is a policy change affecting other researchers, not a routine diagnostic step.&lt;/p&gt;

&lt;h2 id=&quot;explain-priority-without-promising-a-start-time&quot;&gt;Explain priority without promising a start time&lt;/h2&gt;

&lt;p&gt;Where multifactor priority is used, inspect its components:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sprio &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 123456 &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
sshare &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A site’s weights determine how age, fair share, size and other factors contribute. A high numeric priority is not a universal queue position across different partition tiers, reservations and eligibility conditions. The &lt;a href=&quot;https://slurm.schedmd.com/priority_multifactor.html&quot;&gt;multifactor guide&lt;/a&gt; describes the evaluation order and available factors.&lt;/p&gt;

&lt;p&gt;Explain the result in language tied to the job: it is eligible, but other eligible work is evaluated first under the site’s policy. Avoid telling a user that fair share is a fixed personal credit balance or that a particular elapsed wait guarantees dispatch. Both claims can create expectations the configured scheduler does not support.&lt;/p&gt;

&lt;h2 id=&quot;understand-why-backfill-cares-about-wall-time&quot;&gt;Understand why backfill cares about wall time&lt;/h2&gt;

&lt;p&gt;Backfill looks for work that can use otherwise idle capacity without delaying protected higher-priority work. A short request may fit an available interval when a long request cannot. That does not mean users should understate runtime. A job killed at its time limit has exchanged queue delay for lost computation.&lt;/p&gt;

&lt;p&gt;Use a defensible time estimate from representative runs. If the application can checkpoint and resume, consider smaller meaningful work units. If it cannot, request the time it needs and explain the placement consequence.&lt;/p&gt;

&lt;p&gt;A predicted start can be inspected with:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;squeue &lt;span class=&quot;nt&quot;&gt;--start&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 123456
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Treat the result as a scheduling estimate. New submissions, job completion times, reservations and policy can change it. The &lt;a href=&quot;https://slurm.schedmd.com/sched_config.html&quot;&gt;scheduling guide&lt;/a&gt; explains why event-driven scheduling and backfill can produce different observations during the same investigation.&lt;/p&gt;

&lt;h2 id=&quot;use-a-smaller-diagnostic-request-carefully&quot;&gt;Use a smaller diagnostic request carefully&lt;/h2&gt;

&lt;p&gt;A reduced test can identify which dimension matters. For example, a short one-GPU test may establish that the account and partition are usable, while the original multi-node request still cannot fit. Change one dimension at a time and label the new job as a diagnostic experiment.&lt;/p&gt;

&lt;p&gt;Do not submit a large array of probes. It burdens scheduling and can trigger new limits. Do not use a successful tiny job as proof that the original request is valid; the original may require a particular topology or concurrent resource set.&lt;/p&gt;

&lt;p&gt;Once the constraint is understood, offer a choice the researcher can evaluate: wait for the required resource shape, use a compatible partition, correct a stale constraint or restructure the work if the science allows it. Each option should preserve the application’s actual requirements.&lt;/p&gt;

&lt;h2 id=&quot;close-with-an-explanation-that-can-be-checked&quot;&gt;Close with an explanation that can be checked&lt;/h2&gt;

&lt;p&gt;A good pending-job report contains the effective request, the blocking constraint, the observations that support it and the expected next condition. It distinguishes invalid requests from eligible jobs waiting under policy.&lt;/p&gt;

&lt;p&gt;If the investigation finds a scheduler fault, preserve the controller version, relevant configuration and bounded logs before changing anything. If the scheduler is behaving as configured, document that behavior clearly. Explain which event or request change would make the job eligible to start. If a policy change is needed, make that a separate decision for the people who share the cluster.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/slurm-cgroup-v2-gpu-isolation-validation/&quot;&gt;Advanced Slurm setup: prove CPU, memory and GPU isolation before admitting jobs&lt;/a&gt;, &lt;a href=&quot;/writing/slurm-efficiency-accounting-traps/&quot;&gt;Reading Slurm accounting without fooling yourself about efficiency&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Advanced Slurm setup: prove CPU, memory and GPU isolation before admitting jobs</title>
    <link href="https://www.wirewalk.com/writing/slurm-cgroup-v2-gpu-isolation-validation/"/>
    <published>2026-10-26T10:00:00-04:00</published>
    <updated>2026-10-26T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/slurm-cgroup-v2-gpu-isolation-validation/</id>
    <summary>Build a Slurm admission test around CPU placement, memory enforcement, GPU device access and process cleanup, then carry that evidence through image and driver changes.</summary>
    <content type="html">&lt;p&gt;Before opening a new Slurm node to users, run two small jobs beside each other and check what each can access. Correct allocation records will not protect a researcher if the operating system lets a neighboring job use the same CPUs, memory or GPUs.&lt;/p&gt;

&lt;p&gt;Follow the running task into its cgroups and inspect the devices it can open. That connects the scheduler’s allocation to what is enforced on the node, including cleanup when the job ends.&lt;/p&gt;

&lt;p&gt;The configuration fragments below assume Linux with cgroup v2 and whole NVIDIA GPUs. They need site-specific review before use. Test MIG, GPU sharing, SSH adoption and each container runtime separately against the deployed release.&lt;/p&gt;

&lt;h2 id=&quot;separate-selection-enforcement-and-accounting&quot;&gt;Separate selection, enforcement and accounting&lt;/h2&gt;

&lt;p&gt;Treat these as three questions. What does Slurm reserve? What can a task consume? What does the site measure afterward? A sensible answer to one does not establish the other two.&lt;/p&gt;

&lt;p&gt;For a site using consumable trackable resources, the conceptual configuration might include:&lt;/p&gt;

&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Illustrative slurm.conf fragments; review with the installed release.
&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;SelectType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;select/cons_tres&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;SelectTypeParameters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;CR_Core_Memory&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ProctrackType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;proctrack/cgroup&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;TaskPlugin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;task/affinity,task/cgroup&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;JobAcctGatherType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;jobacct_gather/cgroup&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;GresTypes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;gpu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The corresponding enforcement intent might be:&lt;/p&gt;

&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Illustrative cgroup.conf fragments, not a drop-in migration file.
&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;CgroupPlugin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;autodetect&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ConstrainCores&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;yes&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ConstrainRAMSpace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;yes&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ConstrainDevices&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Read the installed &lt;a href=&quot;https://slurm.schedmd.com/cgroup.conf.html&quot;&gt;cgroup.conf reference&lt;/a&gt; before choosing values, especially memory and swap policy. An administrator must reserve enough memory for the operating system and node services rather than advertise every physical byte to jobs. Review whether a limit applies to the job, a step or both before designing a test around it.&lt;/p&gt;

&lt;h2 id=&quot;establish-what-the-node-actually-booted&quot;&gt;Establish what the node actually booted&lt;/h2&gt;

&lt;p&gt;Start with a drained canary and record its kernel, systemd, Slurm, driver and image identifiers. An image inventory is incomplete if the booted kernel differs from the one used to build the software stack.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;uname&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;
slurmd &lt;span class=&quot;nt&quot;&gt;-V&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;stat&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fc&lt;/span&gt; %T /sys/fs/cgroup
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/self/cgroup
systemctl show slurmd &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; Delegate &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ControlGroup
slurmd &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt;
slurmd &lt;span class=&quot;nt&quot;&gt;-G&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The last commands inspect discovered hardware and GPU configuration; they are not substitutes for running jobs. Compare their output with the controller’s node definition. Watch for CPU topology changes caused by firmware settings, missing GPU libraries and a driver that has not loaded.&lt;/p&gt;

&lt;p&gt;Slurm’s &lt;a href=&quot;https://slurm.schedmd.com/cgroup_v2.html&quot;&gt;cgroup v2 design documentation&lt;/a&gt; explains its relationship with systemd and controller delegation. Avoid repairing startup errors by manually building a competing cgroup hierarchy. That can make one launch work while leaving daemon restart and cleanup behavior inconsistent.&lt;/p&gt;

&lt;h2 id=&quot;test-cpu-placement-with-two-allocations&quot;&gt;Test CPU placement with two allocations&lt;/h2&gt;

&lt;p&gt;Use two small, independent allocations on the canary. Have each report its assigned CPU mask and then run a bounded CPU workload. The test asks whether their permitted CPU sets match the site’s sharing policy.&lt;/p&gt;

&lt;p&gt;Inside each allocation, a minimal observation step is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;srun &lt;span class=&quot;nt&quot;&gt;--ntasks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 &lt;span class=&quot;nt&quot;&gt;--cpus-per-task&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;2 &lt;span class=&quot;nt&quot;&gt;--cpu-bind&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;verbose bash &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;
  hostname
  grep Cpus_allowed_list /proc/self/status
  cat /proc/self/cgroup
&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Request memory explicitly in the enclosing allocation and retain both job IDs. Physical cores, hardware threads and logical CPU IDs are different descriptions of the machine. An apparently overlapping numbering scheme needs interpretation against the actual topology rather than an immediate configuration change.&lt;/p&gt;

&lt;p&gt;After the simple case works, test the supported multithreaded application pattern. A task that receives two CPUs but starts dozens of OpenMP or numerical-library threads may remain confined and still perform badly. Set thread counts deliberately, then verify binding. Isolation prevents interference; it does not automatically choose an efficient process layout.&lt;/p&gt;

&lt;h2 id=&quot;prove-memory-behavior-without-damaging-a-shared-node&quot;&gt;Prove memory behavior without damaging a shared node&lt;/h2&gt;

&lt;p&gt;A controlled memory test belongs in an isolated canary allocation with no unrelated users. Define the expected failure before running it: the workload exceeds its assigned memory budget, the appropriate job or step is terminated according to policy, and the node and neighboring services remain healthy.&lt;/p&gt;

&lt;p&gt;Do not use an unbounded allocation loop copied from a troubleshooting forum. Use a reviewed test with a fixed maximum, a timeout and an allocation comfortably below physical capacity. Retain the job record, step record, kernel event time and relevant cgroup counters.&lt;/p&gt;

&lt;p&gt;The result should distinguish a job-level memory limit from a node-wide OOM event. A node remaining responsive is useful evidence, but it does not by itself prove the job was killed by the intended controller. Accounting configuration also affects what memory statistics mean. Record the metric’s source instead of treating every field named RSS as interchangeable.&lt;/p&gt;

&lt;h2 id=&quot;test-gpu-access-not-only-an-environment-variable&quot;&gt;Test GPU access, not only an environment variable&lt;/h2&gt;

&lt;p&gt;For NVIDIA GPUs, compare the allocation, GPU UUIDs and the devices visible inside the task. Slurm’s &lt;a href=&quot;https://slurm.schedmd.com/gres.html&quot;&gt;GRES guide&lt;/a&gt; describes how allocation and CUDA visibility interact, including the possibility that device numbering differs inside a constrained job.&lt;/p&gt;

&lt;p&gt;Within a GPU allocation:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;srun &lt;span class=&quot;nt&quot;&gt;--ntasks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 bash &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;
  printf &quot;CUDA_VISIBLE_DEVICES=%s\n&quot; &quot;${CUDA_VISIBLE_DEVICES-}&quot;
  nvidia-smi --query-gpu=uuid,pci.bus_id,name --format=csv,noheader
&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use UUIDs to reconcile identity. Seeing the requested GPU is only the positive test. A site-owned validation program should also establish that a job cannot use an unallocated GPU under the supported launch paths. Do not assume listing behavior and compute-access behavior are identical.&lt;/p&gt;

&lt;p&gt;Repeat through each supported container runtime. A runtime hook, device bind or broad privileged execution path can change the access boundary. Test a CPU-only job as well: the absence of a GPU request should not silently grant access to every device on the host.&lt;/p&gt;

&lt;h2 id=&quot;include-exit-and-cleanup-in-the-contract&quot;&gt;Include exit and cleanup in the contract&lt;/h2&gt;

&lt;p&gt;A well-behaved process ending normally is the easy case. Test cancellation, a failed step, a child process that outlives its parent and the site’s approved interactive access mechanism. After each case, check for remaining processes and allocated resources before admitting another job.&lt;/p&gt;

&lt;p&gt;Do not equate the batch shell exiting with all descendants being gone. Equally, do not kill every process belonging to a user as a cleanup shortcut; that user may have another legitimate allocation on the same node. The cleanup boundary should follow the allocation’s ownership.&lt;/p&gt;

&lt;p&gt;Record any SSH adoption policy separately. An interactive session outside the normal task-launch path needs its own evidence. A successful &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun&lt;/code&gt; isolation test cannot prove what happens to a process started another way.&lt;/p&gt;

&lt;h2 id=&quot;carry-the-test-through-a-lifecycle-change&quot;&gt;Carry the test through a lifecycle change&lt;/h2&gt;

&lt;p&gt;Keep the canary suite small enough to rerun after a driver update, a Slurm upgrade, a kernel change or a compute-image rebuild. Save expected outcomes with the configuration revision and actual results with the booted image identity.&lt;/p&gt;

&lt;p&gt;The release gate should include a controlled reboot and readmission. Otherwise, the site has tested a live repair rather than the configuration that future nodes will receive. Rollback means restoring a known compatible image and configuration together, then rerunning the same admission checks.&lt;/p&gt;

&lt;p&gt;Keep the passing results with the node image and Slurm configuration. When a later job interferes with its neighbor, repeat the relevant test against that baseline before changing the fleet.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/slurm-job-failure-memory-exit-code-debugging/&quot;&gt;Advanced Slurm job troubleshooting: memory, exit codes and missing evidence&lt;/a&gt;, &lt;a href=&quot;/writing/nvidia-enroot-pyxis-slurm-container-pipeline/&quot;&gt;NVIDIA containers under Slurm: operating Enroot and Pyxis as a supported service&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Redfish firmware rollouts for HPC: from inventory to verified readmission</title>
    <link href="https://www.wirewalk.com/writing/redfish-firmware-rollout-slurm-admission-gates/"/>
    <published>2026-10-25T10:00:00-04:00</published>
    <updated>2026-10-25T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/redfish-firmware-rollout-slurm-admission-gates/</id>
    <summary>Plan firmware maintenance by hardware compatibility and failure domain, track transfer and activation separately, then verify boot, fabric, storage and scheduled workloads before readmission.</summary>
    <content type="html">&lt;p&gt;Do not return a node to researchers just because its firmware update task succeeded. First check what booted and run a small scheduled workload. The package can be installed correctly while the host has lost an adapter, changed topology or booted from the wrong target.&lt;/p&gt;

&lt;p&gt;Firmware maintenance on HPC and GPU systems needs checks for CPU topology, PCIe devices, adapter enumeration, link speed and boot order. Follow the update from the BMC through the operating system and back into the scheduler.&lt;/p&gt;

&lt;p&gt;Use the platform’s documentation for package dependencies, application timing and recovery. The procedure below outlines a generic rollout using supported Redfish capabilities; it contains no power or flash commands.&lt;/p&gt;

&lt;h2 id=&quot;build-a-compatibility-inventory&quot;&gt;Build a compatibility inventory&lt;/h2&gt;

&lt;p&gt;Collect model, hardware revision, installed components, current firmware, boot mode and relevant operating-system stack. Include adapters and accelerators rather than treating the server as one versioned object.&lt;/p&gt;

&lt;p&gt;Discover the UpdateService and its linked firmware inventory. Preserve the actual resource identity and component mapping. Two entries with similar names may describe different banks, devices or stages of activation.&lt;/p&gt;

&lt;p&gt;DMTF’s &lt;a href=&quot;https://redfish.dmtf.org/schemas/v1/UpdateService.v1_11_1.json&quot;&gt;UpdateService schema&lt;/a&gt; defines standard properties and actions, but implementation support varies. Compare the discovered service with the vendor’s supported update method. Do not assume that a package valid for one server family applies to a superficially similar chassis.&lt;/p&gt;

&lt;h2 id=&quot;separate-package-approval-from-execution&quot;&gt;Separate package approval from execution&lt;/h2&gt;

&lt;p&gt;For each package, retain the vendor source, checksum, signature-verification result where supported, supported hardware, dependencies, prerequisites and downgrade policy. A package filename is not a sufficient identity.&lt;/p&gt;

&lt;p&gt;Choose an approved target combination, not merely the latest individual component releases. Firmware, host drivers and fabric software may have compatibility requirements that make a mixed set inappropriate.&lt;/p&gt;

&lt;p&gt;Record why the change is needed: a security correction, a supported-stack requirement or a verified fault. That purpose determines the acceptance tests. An update intended to fix link recovery should include a relevant recovery test, not only a general boot check.&lt;/p&gt;

&lt;h2 id=&quot;define-the-failure-domain-budget&quot;&gt;Define the failure-domain budget&lt;/h2&gt;

&lt;p&gt;Group nodes by their role and shared dependencies. Compute nodes, login nodes, controllers and storage servers cannot share one generic concurrency setting. Several individually healthy resets can still remove a critical service if they occur together.&lt;/p&gt;

&lt;p&gt;For compute maintenance, drain nodes through the scheduler and wait for the agreed workload condition. Do not interpret a drained state as proof that no process or service depends on the host. Confirm jobs, interactive sessions and any non-Slurm responsibilities.&lt;/p&gt;

&lt;p&gt;Storage maintenance needs the storage platform’s supported redundancy and recovery procedure. Never reuse a compute-node batch policy for storage servers merely because both expose Redfish. Stop conditions should include degraded redundancy, ongoing rebuilds and any loss of the management recovery path.&lt;/p&gt;

&lt;h2 id=&quot;validate-the-out-of-band-path-before-disruption&quot;&gt;Validate the out-of-band path before disruption&lt;/h2&gt;

&lt;p&gt;Confirm management connectivity, target identity and available recovery mechanisms before initiating an update. Check the console or equivalent recovery access that would be needed if the operating system fails to return.&lt;/p&gt;

&lt;p&gt;Distinguish a management-controller reset from a host reset. An update may temporarily interrupt the BMC without rebooting the host, or may require a later host power cycle to activate. The automation must know which event it expects and how long its timeout reasonably allows.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://redfish.dmtf.org/schemas/v1/ComputerSystem.v1_17_0.json&quot;&gt;ComputerSystem schema&lt;/a&gt; describes standard reset and boot properties. Use the actual service’s advertised capabilities; a schema enum lists possible values, not a guarantee that every device supports them all.&lt;/p&gt;

&lt;h2 id=&quot;treat-transfer-installation-and-activation-separately&quot;&gt;Treat transfer, installation and activation separately&lt;/h2&gt;

&lt;p&gt;DMTF’s &lt;a href=&quot;https://www.dmtf.org/sites/default/files/standards/documents/DSP2062_1.1.0.pdf&quot;&gt;Firmware Update White Paper 1.1.0&lt;/a&gt;, published in September 2025, describes update workflows including image transfer and installation. A transferred image may be staged for later activation rather than immediately running.&lt;/p&gt;

&lt;p&gt;Track these phases explicitly in the maintenance record. Preserve the response, task monitor, task messages and required next action. If a reset is needed, identify who owns it and whether it is included in the approved window.&lt;/p&gt;

&lt;p&gt;Do not equate &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OnReset&lt;/code&gt; with permission to reset whenever convenient. It describes application timing. The scheduler, research workload and service owners still determine when disruption is acceptable.&lt;/p&gt;

&lt;h2 id=&quot;use-one-canary-per-meaningful-hardware-class&quot;&gt;Use one canary per meaningful hardware class&lt;/h2&gt;

&lt;p&gt;Choose a canary that represents the component combination being updated. One successful host does not validate a different motherboard revision, accelerator type or network adapter.&lt;/p&gt;

&lt;p&gt;Save pre-change inventory and configuration, then follow the vendor-supported update sequence. Reconcile uncertain task outcomes before retrying. If the network connection drops after submission, the operation may still be running.&lt;/p&gt;

&lt;p&gt;After activation, rediscover resources. Device identifiers and inventory paths may change. Rebind the automation to stable asset identity rather than continuing with a stale URI that happened to work before the update.&lt;/p&gt;

&lt;h2 id=&quot;verify-what-booted-and-what-the-os-sees&quot;&gt;Verify what booted and what the OS sees&lt;/h2&gt;

&lt;p&gt;Compare the running firmware with the approved target. Then check the host’s boot mode, boot target, CPU topology, memory inventory, PCIe devices and relevant driver initialization.&lt;/p&gt;

&lt;p&gt;For an NVIDIA GPU node, compare GPU UUIDs, driver health and PCIe topology with the pre-change record. For an RDMA node, confirm expected adapters, active links, addresses and supported communication tests. A host reachable by SSH can still be missing the device that makes it useful.&lt;/p&gt;

&lt;p&gt;Verify that required filesystems are mounted from their intended sources. A missing shared mount can leave an ordinary local directory underneath it. A simple write test without mount identity can therefore certify the wrong storage path.&lt;/p&gt;

&lt;h2 id=&quot;readmit-through-the-scheduler-not-around-it&quot;&gt;Readmit through the scheduler, not around it&lt;/h2&gt;

&lt;p&gt;Compare the controller’s resource view with the host inventory. A topology change can make an old node definition inaccurate even when the hardware itself is healthy. Resolve registration and GRES mismatches before accepting production work.&lt;/p&gt;

&lt;p&gt;Run a small scheduled acceptance job covering the node’s role: CPU placement, bounded memory behavior, GPU computation, storage access and communication where relevant. Check output correctness and cleanup, not just process startup.&lt;/p&gt;

&lt;p&gt;Only resume the node after the agreed gates pass. A failed acceptance test should leave it unavailable with a concise reason and an evidence path. Automatically resuming every host whose SSH port opens removes the protection the maintenance workflow was meant to provide.&lt;/p&gt;

&lt;h2 id=&quot;make-rollback-realistic&quot;&gt;Make rollback realistic&lt;/h2&gt;

&lt;p&gt;Firmware rollback is not always supported, immediate or safe. Some updates change persistent formats, security settings or compatibility assumptions. Check the vendor’s documented downgrade constraints before claiming that the previous package is a recovery plan.&lt;/p&gt;

&lt;p&gt;Prepare supported recovery media or procedures and retain configuration backups where applicable. If the platform cannot be downgraded, define an alternative containment plan, such as leaving the canary drained while the issue is investigated.&lt;/p&gt;

&lt;p&gt;Do not begin the next wave while the canary has unresolved anomalies. Increasing concurrency to recover schedule time after a warning multiplies uncertainty across the fleet.&lt;/p&gt;

&lt;h2 id=&quot;preserve-a-per-node-release-record&quot;&gt;Preserve a per-node release record&lt;/h2&gt;

&lt;p&gt;Record asset identity, previous and target versions, package identity, operation and task IDs, activation event, health-test results and scheduler readmission time. Keep credentials and sensitive inventory details out of public reports.&lt;/p&gt;

&lt;p&gt;Expand in bounded waves with explicit stop conditions. Compare post-change workload behavior with the baseline, including failures and tail latency rather than only best-case throughput.&lt;/p&gt;

&lt;p&gt;Keep failed nodes drained, with the failed test and recovery plan attached. For nodes that pass, retain the version and workload results before readmission so the next maintenance window starts from a known baseline.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/redfish-automation-state-machines-tasks-etags/&quot;&gt;Advanced Redfish automation: discovery, tasks and uncertain outcomes&lt;/a&gt;, &lt;a href=&quot;/writing/slurm-cgroup-v2-gpu-isolation-validation/&quot;&gt;Advanced Slurm setup: prove CPU, memory and GPU isolation before admitting jobs&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>GPFS multihomed storage: when ARP filtering hides a second RDMA path</title>
    <link href="https://www.wirewalk.com/writing/gpfs-multihomed-storage-arp-source-routing/"/>
    <published>2026-10-25T10:00:00-04:00</published>
    <updated>2026-10-25T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/gpfs-multihomed-storage-arp-source-routing/</id>
    <summary>Diagnose a missing GPFS storage path by tracing IPoIB neighbor discovery, ARP filtering and source routing. Preserve peer traffic, verify both RDMA paths and make the fix survive interface changes.</summary>
    <content type="html">&lt;p&gt;Check the second storage port while a client workload is running. It may be healthy and carrying storage-peer traffic, yet carrying none of the client traffic it was meant to serve. Jobs continue, so the missing path can remain unnoticed.&lt;/p&gt;

&lt;p&gt;Before changing GPFS tuning or adding storage, check whether clients can discover and reach every intended storage address. An IPv4 neighbor-discovery failure can prevent an RDMA path from being established.&lt;/p&gt;

&lt;p&gt;The fix described here adds &lt;strong&gt;source-based routing while retaining the existing ARP policy&lt;/strong&gt;. ARP filtering stays enabled.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is a generalized engineering example. The address plan, names, interface labels and routing identifiers are illustrative. Production logs, inventory, incident dates and benchmark figures are deliberately omitted.&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;start-with-the-missing-path-not-the-aggregate-throughput&quot;&gt;Start with the missing path, not the aggregate throughput&lt;/h2&gt;

&lt;p&gt;The useful symptom is a disagreement between the intended topology and the connections actually carrying client traffic. A server’s second port may be active for storage-peer traffic while remaining unused by clients. Link state alone cannot distinguish those cases.&lt;/p&gt;

&lt;p&gt;Build a small observation set: one affected client, one multihomed storage server, and the corresponding interfaces. Record client-to-storage connections separately from storage-to-storage connections. Measure traffic during a known workload using RDMA hardware-counter deltas, with timestamps and understood units.&lt;/p&gt;

&lt;p&gt;An IPoIB packet capture helps explain IP and ARP exchanges; it is not a complete capture of the verbs data stream. Likewise, a successful IPv4 ping establishes only one layer of reachability. Neither observation, on its own, proves that GPFS is moving data through both RDMA paths.&lt;/p&gt;

&lt;p&gt;This discussion concerns an IPoIB configuration in which RDMA connection establishment depends on the relevant IP addresses being reachable. Check the installed Storage Scale release and its RDMA configuration first. IBM documents &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsRdmaCm&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsPorts&lt;/code&gt; in the &lt;a href=&quot;https://www.ibm.com/docs/en/storage-scale/5.2.3?topic=reference-mmchconfig-command&quot;&gt;configuration reference&lt;/a&gt;. Multiple RDMA ports, multiple daemon-network addresses, and TCP multirail are distinct configuration questions.&lt;/p&gt;

&lt;h2 id=&quot;a-simplified-overlapping-address-plan&quot;&gt;A simplified overlapping address plan&lt;/h2&gt;

&lt;p&gt;Suppose one shared InfiniBand fabric carries the following illustrative configuration:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Endpoint&lt;/th&gt;
      &lt;th&gt;Interface&lt;/th&gt;
      &lt;th&gt;IPv4 address or range&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Client&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib0&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.0.2.23/24&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Storage server, primary path&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib0&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.0.2.81/24&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Storage server, additional path&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib1&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.0.2.209/25&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Primary addresses of storage peers&lt;/td&gt;
      &lt;td&gt;—&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.0.2.80/28&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;These addresses use the &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc5737.html&quot;&gt;documentation prefix reserved by RFC 5737&lt;/a&gt;. They are not an address plan to deploy.&lt;/p&gt;

&lt;p&gt;The important relationship is that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.0.2.128/25&lt;/code&gt;, the additional interface’s subnet, lies inside the client’s broader &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.0.2.0/24&lt;/code&gt; network. The example client is outside that narrower subnet. Both interfaces can attach to the shared fabric while the main routing table makes different choices for their destinations.&lt;/p&gt;

&lt;p&gt;A simplified main table on the storage server contains:&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;192.0.2.0/24 dev ib0 src 192.0.2.81
192.0.2.128/25 dev ib1 src 192.0.2.209
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A lookup for the client selects &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib0&lt;/code&gt;. A lookup for an address inside the narrower subnet selects &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib1&lt;/code&gt;. This is normal longest-prefix route selection. It becomes a problem when the server’s ARP reply policy expects the return route for an address on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib1&lt;/code&gt; to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Two ports on one fabric also do not constitute two independent fabrics. Reachability, available bandwidth and failure isolation need separate acceptance criteria.&lt;/p&gt;

&lt;h2 id=&quot;understand-which-filter-is-making-the-decision&quot;&gt;Understand which filter is making the decision&lt;/h2&gt;

&lt;p&gt;For this failure pattern, the relevant policy has &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arp_filter=1&lt;/code&gt;. The kernel considers routing when deciding whether to answer an ARP request on an interface. A request for the additional address can arrive on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib1&lt;/code&gt;, yet fail that decision because a route back to the requesting client selects &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arp_ignore=1&lt;/code&gt; is different: it restricts replies to target addresses configured on the receiving interface. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arp_announce&lt;/code&gt; concerns source-address selection in outgoing ARP requests. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rp_filter&lt;/code&gt; checks the source of received IPv4 packets; it does not filter ARP frames.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.kernel.org/doc/html/v6.12/networking/ip-sysctl.html&quot;&gt;Linux IPv4 sysctl documentation&lt;/a&gt; explains these distinctions and the source-routing requirement for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arp_filter&lt;/code&gt;. It also documents how &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;all&lt;/code&gt; and interface-specific values interact. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;default&lt;/code&gt; supplies settings for interfaces created later; it is not a readback of every existing interface.&lt;/p&gt;

&lt;p&gt;The policies must agree with the routing design. Relaxing them may hide an incorrect path, change which interface answers, or expose a separate reverse-path problem. Establish the decision being made before changing it.&lt;/p&gt;

&lt;h2 id=&quot;capture-the-failing-discovery-exchange&quot;&gt;Capture the failing discovery exchange&lt;/h2&gt;

&lt;p&gt;On the client, first establish how the additional storage address would be reached:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; route get 192.0.2.209
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; neigh show to 192.0.2.209 dev ib0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For this example, the client should regard the address as on-link through its IPoIB interface. If a gateway or another interface appears instead, investigate that route before attributing the failure to the storage server.&lt;/p&gt;

&lt;p&gt;Observe a bounded probe from the client:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ping &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt; 192.0.2.23 &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; 3 192.0.2.209
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; neigh show to 192.0.2.209 dev ib0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The source address must be assigned to that client. An &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;INCOMPLETE&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FAILED&lt;/code&gt; neighbor entry is evidence that resolution did not complete, not proof of why it failed.&lt;/p&gt;

&lt;p&gt;On the storage server, watch the candidate receiving interface while the probe runs:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;timeout &lt;/span&gt;15 tcpdump &lt;span class=&quot;nt&quot;&gt;-ni&lt;/span&gt; ib1 &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; 20 arp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The timeout bounds the observation; reaching it is not itself a diagnosis. Confirm whether requests arrive and whether replies leave. If requests never arrive, investigate the client path, fabric membership and interface configuration. If replies leave but never reach the client, investigate the return path and receiving side. The routing-policy hypothesis becomes stronger when requests arrive on the expected interface but the server does not answer them.&lt;/p&gt;

&lt;p&gt;Keep captures local to the investigation. IPoIB link-layer addresses, hostnames and management details can identify an environment just as readily as ordinary IP addresses.&lt;/p&gt;

&lt;h2 id=&quot;ask-for-the-route-with-the-correct-source&quot;&gt;Ask for the route with the correct source&lt;/h2&gt;

&lt;p&gt;On the storage server, collect the actual state:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-brief&lt;/span&gt; address show
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; rule show
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; route show table main

&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;scope &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;all default ib0 ib1&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
    &lt;/span&gt;sysctl &lt;span class=&quot;s2&quot;&gt;&quot;net.ipv4.conf.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.arp_filter&quot;&lt;/span&gt;
    sysctl &lt;span class=&quot;s2&quot;&gt;&quot;net.ipv4.conf.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.arp_ignore&quot;&lt;/span&gt;
    sysctl &lt;span class=&quot;s2&quot;&gt;&quot;net.ipv4.conf.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.rp_filter&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then compare route lookups that preserve the source address of each storage path:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; route get 192.0.2.23 from 192.0.2.81
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; route get 192.0.2.23 from 192.0.2.209
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If both choose &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib0&lt;/code&gt;, the additional address has no source-specific policy returning to this client through &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib1&lt;/code&gt;. The destination-only lookup was insufficient to expose that distinction.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://man7.org/linux/man-pages/man8/ip-route.8.html&quot;&gt;ip-route reference&lt;/a&gt; documents source-qualified lookups. Run them in the network namespace that owns the relevant interfaces. A lookup is a routing observation, not proof that every receive-side check will accept a packet; the bounded probe and capture still matter.&lt;/p&gt;

&lt;p&gt;Repeat this analysis for storage peers and management destinations. A source-only rule can affect more traffic than the client connection that motivated it.&lt;/p&gt;

&lt;h2 id=&quot;design-the-exception-before-the-broad-rule&quot;&gt;Design the exception before the broad rule&lt;/h2&gt;

&lt;p&gt;The proposed policy for this example has three parts:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;A dedicated table sends client-network destinations through the additional interface.&lt;/li&gt;
  &lt;li&gt;A higher-priority exception keeps the primary storage-peer range on its existing main-table policy.&lt;/li&gt;
  &lt;li&gt;A following rule directs other traffic sourced from the additional storage address to the dedicated table.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The exception is important because the client network contains the primary storage-peer range too. Without it, a broad source rule would also change those peer route decisions.&lt;/p&gt;

&lt;p&gt;Here is an explicit &lt;strong&gt;plan printer&lt;/strong&gt;, not an applying script:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-euo&lt;/span&gt; pipefail

&lt;span class=&quot;c&quot;&gt;# Entirely illustrative values. This block only prints a proposed change.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;%s\n&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&apos;ip -4 route replace 192.0.2.0/24 dev ib1 src 192.0.2.209 table 210&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&apos;ip -4 rule add priority 12200 from 192.0.2.209/32 to 192.0.2.80/28 lookup main&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&apos;ip -4 rule add priority 12210 from 192.0.2.209/32 lookup 210&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Table &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;210&lt;/code&gt; and priorities &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;12200&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;12210&lt;/code&gt; are arbitrary examples. Inventory existing tables and rules, then allocate identifiers that the site’s configuration system owns. Verify the address assignment, intended on-link reachability, table contents and rule ordering before applying a reviewed equivalent.&lt;/p&gt;

&lt;p&gt;Linux evaluates policy rules in priority order, with lower numeric values first. The &lt;a href=&quot;https://man7.org/linux/man-pages/man8/ip-rule.8.html&quot;&gt;ip-rule reference&lt;/a&gt; describes selectors and table lookups. Here the peer exception is considered before the additional-path rule, and both precede the ordinary main-table rule in a typical default configuration. Existing rules can change that outcome; read the complete policy database.&lt;/p&gt;

&lt;p&gt;A dedicated table with no default route does not necessarily block other destinations. If its lookup finds no route, policy processing can continue to later rules. Decide whether that fallback is wanted, especially for management traffic. Do not add a default route merely to make the table look complete.&lt;/p&gt;

&lt;p&gt;For a new design, consider a simpler, release-supported network arrangement first. Source routing is a way to reconcile this particular overlapping configuration, not a reason to create overlapping subnets on every new cluster.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-route-matrix-and-the-peer-exception&quot;&gt;Verify the route matrix and the peer exception&lt;/h2&gt;

&lt;p&gt;After applying an authorized, site-specific change on one canary, check all of the following:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; rule show
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; route show table 210

&lt;span class=&quot;c&quot;&gt;# Primary source to client: retain the primary path.&lt;/span&gt;
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; route get 192.0.2.23 from 192.0.2.81

&lt;span class=&quot;c&quot;&gt;# Additional source to client: select the additional path.&lt;/span&gt;
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; route get 192.0.2.23 from 192.0.2.209

&lt;span class=&quot;c&quot;&gt;# Primary storage-peer destination: retain the main-table decision.&lt;/span&gt;
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; route get 192.0.2.82 from 192.0.2.209

&lt;span class=&quot;c&quot;&gt;# Additional-path peer destination: inspect its intended path too.&lt;/span&gt;
ip &lt;span class=&quot;nt&quot;&gt;-4&lt;/span&gt; route get 192.0.2.210 from 192.0.2.209
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The expected interfaces in this simplified example are &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib0&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib1&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib0&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib1&lt;/code&gt;, respectively. Verify management and any other policy-sensitive traffic separately.&lt;/p&gt;

&lt;p&gt;Returning a peer destination to the main table preserves its previous route decision. It does not, by itself, prove that an application has selected the intended source or formed the desired same-rail connections. Inspect those connections and their traffic.&lt;/p&gt;

&lt;p&gt;Repeat the client probe. Neighbor discovery should now complete through the intended storage interface, and IPv4 reachability should work without changing the existing filtering policy. If ARP completes but IP traffic still fails, examine reverse-path filtering, packet filters and the actual return path. Avoid changing several of these controls together and losing the evidence that distinguishes them.&lt;/p&gt;

&lt;h2 id=&quot;recheck-gpfs-after-network-reachability-is-repaired&quot;&gt;Recheck GPFS after network reachability is repaired&lt;/h2&gt;

&lt;p&gt;Restoring IP reachability and obtaining the intended GPFS connection layout are separate steps. In the environment behind this example, already-running clients retained their earlier connection layout after the route change. That observation should not become a universal claim that every Storage Scale release retries addresses in the same way or reports failures identically.&lt;/p&gt;

&lt;p&gt;Check the installed release’s connection diagnostics, including the supported views of:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmlsconfig verbsRdmaCm
mmlsconfig verbsPorts
mmdiag &lt;span class=&quot;nt&quot;&gt;--network&lt;/span&gt;
mmdiag &lt;span class=&quot;nt&quot;&gt;--verbs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--network&lt;/code&gt; for daemon connections and pending RPCs, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--verbs&lt;/code&gt; for RDMA port state. IBM describes these diagnostics in the &lt;a href=&quot;https://www.ibm.com/docs/en/storage-scale/5.2.3?topic=reference-mmdiag-command&quot;&gt;mmdiag reference&lt;/a&gt;. Correlate the reported connections with client and storage addresses, adapters and per-port activity. Additional connection records alone do not establish balanced use or a particular throughput improvement.&lt;/p&gt;

&lt;p&gt;If a client needs a reconnect or daemon restart, use its normal maintenance procedure. Account for active jobs, mounted filesystems, services and other users of that node before taking it out of service. Validate mounts and a representative scheduled workload before readmission. Storage servers have additional availability responsibilities; a client-side observation is not permission to restart them as a group.&lt;/p&gt;

&lt;p&gt;The useful acceptance evidence is that the intended client paths exist and carry the workload, while storage-peer and management behavior remain correct.&lt;/p&gt;

&lt;h2 id=&quot;make-the-policy-survive-an-interface-cycle&quot;&gt;Make the policy survive an interface cycle&lt;/h2&gt;

&lt;p&gt;A live route change is only one part of the fix. Define which configuration system owns the route, rules and any supporting service, including the corresponding machine image.&lt;/p&gt;

&lt;p&gt;In a service-and-dispatcher design, arrange for policy reconciliation after the interface has its address and before consumers depend on that path. Reapply the route when a network profile is reactivated: link lifecycle events can remove routes while leaving policy rules behind.&lt;/p&gt;

&lt;p&gt;A production helper should default to a printed plan and require an explicit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--go&lt;/code&gt; to mutate state. It should detect conflicting ownership, reconcile rather than duplicate rules, and report failure when a required interface or address is missing. “Nothing to do” must not be reported as readiness when GPFS requires that path.&lt;/p&gt;

&lt;p&gt;Service ordering is not the same as a readiness dependency. A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Before=&lt;/code&gt; relationship orders jobs that are already scheduled; it does not independently require the policy job to run successfully. Test the dependency and failure behavior used by the site’s actual GPFS service arrangement.&lt;/p&gt;

&lt;p&gt;Verify an interface reactivation and a controlled reboot through the normal maintenance process. Files installed in an image, an enabled unit and a successful live application are three observations; none substitutes for that lifecycle test.&lt;/p&gt;

&lt;h2 id=&quot;roll-back-only-the-state-this-change-owns&quot;&gt;Roll back only the state this change owns&lt;/h2&gt;

&lt;p&gt;Save the original rules, affected routes and persistence configuration before the canary change. The rollback plan must remove or restore the exact owned rules, the dedicated route and the mechanism that would recreate them.&lt;/p&gt;

&lt;p&gt;Avoid flushing the main table, deleting rules by a broad text match, or flushing a custom table that contains unrelated routes. If a change replaced an existing route, restore that route rather than merely deleting the replacement. Keep the management route and a recovery console available throughout the change.&lt;/p&gt;

&lt;p&gt;After rollback, repeat the route matrix, neighbor probe, GPFS connection inspection and node-readiness checks. Recovery is demonstrated by the resulting state, not just by a script returning zero.&lt;/p&gt;

&lt;h2 id=&quot;establish-usable-paths-before-sizing-the-next-upgrade&quot;&gt;Establish usable paths before sizing the next upgrade&lt;/h2&gt;

&lt;p&gt;Compare a representative workload before and after the change using matched clients, data, concurrency and cache conditions. Capture per-port traffic and application progress together. Do not infer a fixed speedup from the number of ports, or describe a storage-to-storage connection as evidence of client bandwidth.&lt;/p&gt;

&lt;p&gt;Production benchmark results are omitted from this generalized example. To investigate the same symptom, follow neighbor discovery and the source-qualified route, check the peer exception, then verify GPFS connections and persistence.&lt;/p&gt;

&lt;p&gt;Repeat the workload once both client paths are usable. That comparison shows whether the repaired path helps the analysis or training run before another storage change is considered.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Advanced Redfish automation: discovery, tasks and uncertain outcomes</title>
    <link href="https://www.wirewalk.com/writing/redfish-automation-state-machines-tasks-etags/"/>
    <published>2026-10-24T10:00:00-04:00</published>
    <updated>2026-10-24T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/redfish-automation-state-machines-tasks-etags/</id>
    <summary>Build Redfish automation around discovered capabilities, verified identity, asynchronous task tracking, conditional updates and recovery from uncertain request outcomes.</summary>
    <content type="html">&lt;p&gt;What should a script do if its connection drops just after it sends a server reset? Retrying may reset the machine twice; assuming failure may leave a real operation untracked. Redfish automation needs a way to reconcile that uncertainty before issuing another change.&lt;/p&gt;

&lt;p&gt;The resource model standardizes discovery and operations, but supported actions still vary by hardware and firmware. Record the request, follow any returned task and check what the hardware actually did.&lt;/p&gt;

&lt;p&gt;The examples use DMTF’s published specification and placeholder addresses. They include read-only discovery, without credentials or executable power-changing requests.&lt;/p&gt;

&lt;h2 id=&quot;discover-resources-instead-of-inventing-their-paths&quot;&gt;Discover resources instead of inventing their paths&lt;/h2&gt;

&lt;p&gt;Begin at the service root and follow returned resource links. Do not assume that the managed system is always &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/Systems/1&lt;/code&gt;, that a manager identifier matches a chassis identifier or that every device exposes the same OEM extensions.&lt;/p&gt;

&lt;p&gt;A read-only request can use a protected, site-provided curl configuration:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# The config contains site-managed authentication/TLS settings.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# It must not enable verbose credential logging or insecure TLS bypass.&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REDFISH_READ_CONFIG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--connect-timeout&lt;/span&gt; 5 &lt;span class=&quot;nt&quot;&gt;--max-time&lt;/span&gt; 20 &lt;span class=&quot;nt&quot;&gt;--fail-with-body&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&apos;https://bmc.example.invalid/redfish/v1/&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.invalid&lt;/code&gt; address is intentionally non-operational. Validate the management certificate against the site’s trust configuration. Do not make &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-k&lt;/code&gt; the permanent answer to certificate deployment problems.&lt;/p&gt;

&lt;p&gt;Follow collection members and pagination where present. Check the resource type and supported properties before using them. The client’s cached inventory should be tied to the discovered device identity and firmware revision.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-target-before-any-mutation&quot;&gt;Verify the target before any mutation&lt;/h2&gt;

&lt;p&gt;An IP address can be reassigned. A DNS name can point at a replaced controller. Before changing power, boot configuration or firmware, compare the target’s serial number or other stable inventory identity with the approved asset record.&lt;/p&gt;

&lt;p&gt;Separate the BMC’s state from the host’s state. A responsive management controller does not establish that the operating system is running. A powered-on host does not establish that it booted successfully or joined the cluster.&lt;/p&gt;

&lt;p&gt;Make the proposed action reviewable: target identity, current state, desired transition, expected disruption and recovery path. Automation should refuse an ambiguous target rather than letting a naming convention stand in for identity verification.&lt;/p&gt;

&lt;h2 id=&quot;model-operations-as-transitions&quot;&gt;Model operations as transitions&lt;/h2&gt;

&lt;p&gt;Represent an operation with explicit states such as planned, submitted, monitoring, completed, failed and outcome-unknown. Store the target identity, request hash, submission time, relevant response headers and task identifiers in a durable operation journal.&lt;/p&gt;

&lt;p&gt;An HTTP request completing is one observation. The requested host state becoming true is another. A subsequent workload health check is a third. Keep those outcomes separate in the record.&lt;/p&gt;

&lt;p&gt;For power management, define what counts as successful recovery: a fresh boot identifier, operating-system connectivity, required mounts, fabric state and scheduler admission. A successful reset action alone does not establish any of those postconditions.&lt;/p&gt;

&lt;h2 id=&quot;track-asynchronous-work-to-a-terminal-outcome&quot;&gt;Track asynchronous work to a terminal outcome&lt;/h2&gt;

&lt;p&gt;DMTF &lt;a href=&quot;https://redfish.dmtf.org/schemas/DSP0266_1.20.1.html&quot;&gt;Redfish Specification 1.20.1&lt;/a&gt; defines asynchronous responses and task-monitor behavior. Preserve the returned &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Location&lt;/code&gt; and honor &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Retry-After&lt;/code&gt; when provided. HTTP 202 means accepted processing, not completed work.&lt;/p&gt;

&lt;p&gt;Poll with a deadline and bounded intervals. Record the task state, status and messages. A task resource and its task-monitor endpoint have related but distinct protocol roles; use the returned URI according to the specification instead of constructing a monitor path from a guessed task number.&lt;/p&gt;

&lt;p&gt;Task records may expire. Preserve important final details before they disappear. If a monitor returns an unexpected result after a long gap, reconcile against resource state and retained operation evidence rather than assuming a missing task means success.&lt;/p&gt;

&lt;h2 id=&quot;treat-a-lost-response-as-uncertainty&quot;&gt;Treat a lost response as uncertainty&lt;/h2&gt;

&lt;p&gt;A timeout after sending a mutation does not prove the BMC rejected it. The request may have reached the service and the response may have been lost. Blindly replaying a reset, update or account action can create a second operation.&lt;/p&gt;

&lt;p&gt;Classify requests by replay risk. Read-only discovery is generally easier to retry than an action with disruptive effects. For mutations, first inspect the operation journal, discovered task state and target resource before deciding whether replay is safe.&lt;/p&gt;

&lt;p&gt;Do not invent an idempotency header and assume every BMC honors it. If the interface lacks a supported deduplication mechanism, the client needs reconciliation logic and an explicit outcome-unknown state. Some cases should require an operator to resolve uncertainty rather than continuing automatically.&lt;/p&gt;

&lt;h2 id=&quot;prevent-stale-configuration-updates&quot;&gt;Prevent stale configuration updates&lt;/h2&gt;

&lt;p&gt;Where supported, use the resource ETag with a conditional update to avoid overwriting a concurrent change. If the precondition fails, reread the resource and recompute the intended change. Do not automatically replace the condition with a wildcard and force the write through.&lt;/p&gt;

&lt;p&gt;Patch only the properties the operation owns. Preserve unrelated configuration and recognize that some settings are staged for a future reset rather than applied immediately. An accepted settings update can leave current and pending values different.&lt;/p&gt;

&lt;p&gt;The action’s advertised allowable values and associated ActionInfo resource, when available, are stronger evidence than a payload copied from another manufacturer’s example. Validate those capabilities on the actual firmware revision.&lt;/p&gt;

&lt;h2 id=&quot;interpret-messages-beyond-the-http-status&quot;&gt;Interpret messages beyond the HTTP status&lt;/h2&gt;

&lt;p&gt;Keep structured error details and message identifiers, with sensitive values removed. A general HTTP failure can contain a precise explanation about unsupported parameters, privileges, pending operations or required system state.&lt;/p&gt;

&lt;p&gt;Resolve messages through the appropriate registry where useful. Do not reduce every failure to a generic retry, and do not suppress a warning merely because the outer request returned a success-class status.&lt;/p&gt;

&lt;p&gt;Build test fixtures for supported response shapes, malformed JSON, unavailable resources, throttling, task failure and expired sessions. A client parser should fail clearly when its assumptions are violated. The fixture is a protocol test, not proof that a real server accepted the operation.&lt;/p&gt;

&lt;h2 id=&quot;keep-concurrency-and-credentials-bounded&quot;&gt;Keep concurrency and credentials bounded&lt;/h2&gt;

&lt;p&gt;Limit concurrent operations per management controller and per failure domain. BMCs are small systems, and an aggressive inventory sweep can interfere with the management path needed during an incident.&lt;/p&gt;

&lt;p&gt;Use scoped accounts and the site’s supported secret-delivery mechanism. Protect session tokens, request headers and configuration files. Redact them from operation journals while retaining the nonsecret identity and audit context needed to investigate changes.&lt;/p&gt;

&lt;p&gt;Test session expiry and cleanup. An automation service that leaks sessions can eventually make its own management access unreliable. Credential rotation and controller replacement should be supported lifecycle events rather than emergency script edits.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-intended-postcondition&quot;&gt;Verify the intended postcondition&lt;/h2&gt;

&lt;p&gt;After a successful operation, reread the relevant state and run the independent health checks appropriate to the change. For a boot override, confirm both the configured override and the subsequent boot outcome. For a power action, verify the operating system’s recovery before releasing the node.&lt;/p&gt;

&lt;p&gt;Leave an unresolved operation visible in the journal until task state or an independent check settles it. During a network failure, that record helps the next operator decide whether to wait, investigate or safely retry.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/redfish-firmware-rollout-slurm-admission-gates/&quot;&gt;Redfish firmware rollouts for HPC: from inventory to verified readmission&lt;/a&gt;, &lt;a href=&quot;/writing/management-network-bmc-isolation/&quot;&gt;Management networks: isolate the systems that can rebuild everything&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Node-local scratch under Slurm: stage data without losing the result</title>
    <link href="https://www.wirewalk.com/writing/slurm-node-local-scratch-staging-result-publication/"/>
    <published>2026-10-23T10:00:00-04:00</published>
    <updated>2026-10-23T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/slurm-node-local-scratch-staging-result-publication/</id>
    <summary>Design a node-local staging workflow with capacity checks, immutable inputs, bounded transfers, transactional result publication and explicit recovery after interruption.</summary>
    <content type="html">&lt;p&gt;Local NVMe is a good place to avoid repeated shared-filesystem reads and hold temporary work. It is a poor place for the only copy of a completed result. A reboot, reimage or cleanup can remove that result before anyone notices it was never published.&lt;/p&gt;

&lt;p&gt;Give the job separate states for staged inputs, completed computation and validated publication to project storage. After interruption, an operator should be able to identify which of those stages finished.&lt;/p&gt;

&lt;p&gt;The paths and sizes below are examples. Test the publication procedure against the actual filesystem guarantees and the failures it needs to survive.&lt;/p&gt;

&lt;h2 id=&quot;define-the-lifetime-of-each-copy&quot;&gt;Define the lifetime of each copy&lt;/h2&gt;

&lt;p&gt;Treat the original input, staged working copy, temporary output and published result as different objects. Assign an owner and retention policy to each. A successful stage-in does not authorize deletion of the source, and a successful computation does not authorize deletion of the local result before publication is verified.&lt;/p&gt;

&lt;p&gt;Decide what failure the workflow must survive. A local cache can survive a process restart while still being lost with a node. If the scientific work cannot tolerate that loss, the application needs an appropriate checkpoint or result-publication strategy during execution.&lt;/p&gt;

&lt;p&gt;Document whether the workflow is single-node or distributed. A shared path that looks identical on every node may actually name separate local disks. A multi-node job needs per-node staging and output ownership; one batch-shell copy command does not automatically operate on every host.&lt;/p&gt;

&lt;h2 id=&quot;budget-peak-temporary-space&quot;&gt;Budget peak temporary space&lt;/h2&gt;

&lt;p&gt;Estimate input bytes, expanded data, working files, output, transfer staging and reserve headroom. Include inodes as well as bytes. Compressed input can expand substantially, and a pipeline may retain both packed and unpacked representations during processing.&lt;/p&gt;

&lt;p&gt;For a simple capacity estimate, suppose a task stages 80 GiB of input, creates 120 GiB of working state and produces 30 GiB of output. That is at least 230 GiB before transfer overlap and safety margin. These are illustrative quantities, not measured workload characteristics.&lt;/p&gt;

&lt;p&gt;Test at the intended number of concurrent jobs per node. Free space observed before one job starts is not a reservation against later jobs. Use the site’s supported scratch-allocation mechanism where available, and define how competing jobs are prevented from consuming one another’s budget.&lt;/p&gt;

&lt;h2 id=&quot;use-a-job-specific-namespace&quot;&gt;Use a job-specific namespace&lt;/h2&gt;

&lt;p&gt;A generic path such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/local/scratch/work&lt;/code&gt; invites collisions and cleanup mistakes. Allocate a directory tied to the job and, where necessary, array task and node identity. Verify that it belongs to the invoking user before writing.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Illustrative setup inside a scheduled job.&lt;/span&gt;
: &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;SLURM_JOB_ID&lt;/span&gt;:?Run&lt;span class=&quot;p&quot;&gt; within a Slurm allocation&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
: &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;LOCAL_SCRATCH&lt;/span&gt;:?Set&lt;span class=&quot;p&quot;&gt; the site-approved scratch root&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;work&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mktemp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;LOCAL_SCRATCH&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;%/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/job-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;SLURM_JOB_ID&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.XXXXXX&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;Working directory: %s\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$work&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The scratch root is supplied by site policy, not guessed by the script. Do not replace a failed allocation with an automatic fallback to the home directory. That converts a local-capacity issue into unplanned load on shared storage.&lt;/p&gt;

&lt;p&gt;Retain a small manifest that links the local directory to the job, input version and intended destination. Keep sensitive filenames and credentials out of broadly visible logs.&lt;/p&gt;

&lt;h2 id=&quot;stage-an-immutable-input-version&quot;&gt;Stage an immutable input version&lt;/h2&gt;

&lt;p&gt;Use an explicit input manifest or snapshot identity. If files can change while copying, a checksum taken after the transfer does not necessarily identify the source state used by the application. Establish the input’s consistency boundary first.&lt;/p&gt;

&lt;p&gt;Stage into a temporary namespace, validate expected files and checksums, then mark the local copy ready. A directory existing on disk is not a readiness signal. The application should begin only after the full declared input set passes validation.&lt;/p&gt;

&lt;p&gt;Slurm’s &lt;a href=&quot;https://slurm.schedmd.com/sbatch.html&quot;&gt;sbatch documentation&lt;/a&gt; notes that it transfers the batch script rather than automatically moving the user’s data files. Staging is part of the workflow that the site or application must provide and account for.&lt;/p&gt;

&lt;h2 id=&quot;bound-transfer-concurrency&quot;&gt;Bound transfer concurrency&lt;/h2&gt;

&lt;p&gt;Stage-in can become a synchronized burst when many nodes start together. Limit concurrent readers and avoid having every task independently copy the same dataset. Where appropriate, stage once per node and let local tasks share a validated read-only copy.&lt;/p&gt;

&lt;p&gt;Measure total startup time, shared-storage load and interference with other workloads. A local execution phase that becomes faster can still produce a slower overall workflow if staging dominates the allocation.&lt;/p&gt;

&lt;p&gt;Separate reusable cache content from job-owned work. A cache needs immutable keys, completeness markers, locking and eviction rules. Without those, two jobs can mistake a partially populated cache entry for a valid input dataset.&lt;/p&gt;

&lt;h2 id=&quot;publish-complete-generations&quot;&gt;Publish complete generations&lt;/h2&gt;

&lt;p&gt;Write each result generation into a new destination rather than overwriting the current result while copying. The generation should include output files, a manifest, application identity and validation status. Readers should select only generations that satisfy the completion protocol.&lt;/p&gt;

&lt;p&gt;A same-filesystem rename can provide atomic namespace replacement, as described in &lt;a href=&quot;https://man7.org/linux/man-pages/man2/rename.2.html&quot;&gt;rename(2)&lt;/a&gt;. Moving between local NVMe and a shared filesystem is not that operation; it requires a transfer first. Tools may implement cross-filesystem moves as copy-and-delete.&lt;/p&gt;

&lt;p&gt;For a custom publication protocol, transfer into a temporary directory on the destination filesystem, validate it, then publish a small manifest or pointer using the supported atomic mechanism. A multi-file result requires all participants to agree on what the published pointer means.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-visibility-from-durability&quot;&gt;Distinguish visibility from durability&lt;/h2&gt;

&lt;p&gt;A reader seeing a complete filename does not establish that the data will survive every failure. Linux &lt;a href=&quot;https://man7.org/linux/man-pages/man2/fsync.2.html&quot;&gt;fsync(2)&lt;/a&gt; distinguishes file-data synchronization from directory-entry persistence. A shared filesystem adds its own guarantees and failure boundaries.&lt;/p&gt;

&lt;p&gt;Do not turn a generic rename recipe into a universal durability claim. Review the storage system’s documented semantics and test the interruption cases the research workflow needs to survive. Prefer a framework’s supported transactional or checkpoint mechanism when it supplies the required guarantees.&lt;/p&gt;

&lt;p&gt;Checksums establish byte agreement for the files checked. They do not establish scientific completeness. Validate expected record counts, dimensions, partitions or application invariants before advertising the generation as ready for downstream work.&lt;/p&gt;

&lt;h2 id=&quot;plan-for-time-limits-and-abrupt-failure&quot;&gt;Plan for time limits and abrupt failure&lt;/h2&gt;

&lt;p&gt;Reserve time for publication rather than allowing computation to consume the entire wall-time request. Slurm supports advance signals under documented conditions; review the installed &lt;a href=&quot;https://slurm.schedmd.com/sbatch.html&quot;&gt;sbatch signal options&lt;/a&gt; and test which process receives the signal.&lt;/p&gt;

&lt;p&gt;A signal handler may help an orderly exit, but it cannot guarantee recovery from power loss or an uncatchable kill. Long computations need periodic durable progress if restarting from the beginning is unacceptable.&lt;/p&gt;

&lt;p&gt;Make publication restartable and idempotent. After interruption, a new attempt should distinguish an already validated generation from an incomplete transfer. Never infer success from a destination directory or from the fact that a previous copy process started.&lt;/p&gt;

&lt;h2 id=&quot;clean-up-only-after-the-correct-evidence&quot;&gt;Clean up only after the correct evidence&lt;/h2&gt;

&lt;p&gt;Delete local state only after the durable destination is validated under the workflow’s contract. If publication fails, retain enough metadata to locate the surviving copy and explain how long it will remain available. A node-local retention promise must match the actual cleanup and maintenance policy.&lt;/p&gt;

&lt;p&gt;Test cancellation during stage-in, computation and stage-out using disposable data. Test a fresh allocation reading the published result without access to the original local disk. That is stronger evidence than validating output from the process that still has it cached.&lt;/p&gt;

&lt;p&gt;Only mark the job complete when a fresh allocation can read and validate the published result without the original local disk. Researchers can then rely on the completion status even after the compute node is rebuilt.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/storage-scale-filesets-inodes-quota-troubleshooting/&quot;&gt;Storage Scale has free space, but the job cannot write: filesets, inodes and quotas&lt;/a&gt;, &lt;a href=&quot;/writing/distributed-ai-checkpoint-storage-restart-testing/&quot;&gt;Distributed AI checkpoints: storage performance and restart testing&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Storage Scale has free space, but the job cannot write: filesets, inodes and quotas</title>
    <link href="https://www.wirewalk.com/writing/storage-scale-filesets-inodes-quota-troubleshooting/"/>
    <published>2026-10-22T10:00:00-04:00</published>
    <updated>2026-10-22T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/storage-scale-filesets-inodes-quota-troubleshooting/</id>
    <summary>Diagnose write failures despite free filesystem capacity by separating mount identity, fileset inode space, quota scope, pool headroom and application behavior.</summary>
    <content type="html">&lt;p&gt;“There is plenty of free space” is a frustrating answer when a research job cannot create its output. The filesystem total may be correct while a fileset has exhausted its inode allowance, a quota blocks the user or the required pool lacks headroom. The path may even be on an unexpected mount.&lt;/p&gt;

&lt;p&gt;Capture the failed operation, identity and path, then follow the allocation checks below. Filesystem and project names are illustrative; the commands inspect state without changing quota policy or storage layout.&lt;/p&gt;

&lt;h2 id=&quot;preserve-the-exact-failure&quot;&gt;Preserve the exact failure&lt;/h2&gt;

&lt;p&gt;Capture the failing path, time, job ID, user identity and application message. If possible, preserve the underlying system error rather than only a wrapper’s summary. Permission denied, quota exceeded, no space left and I/O error suggest different branches, though applications may translate them poorly.&lt;/p&gt;

&lt;p&gt;Check whether the operation creates a new file, extends an existing one, renames output or creates a directory. A job can continue reading existing data while being unable to allocate new metadata or blocks.&lt;/p&gt;

&lt;p&gt;Use a small site-approved scratch location for a reproduction. Do not repeatedly rerun an expensive job simply to see whether the symptom returns. Avoid broad namespace scans that add load without testing the failed operation.&lt;/p&gt;

&lt;h2 id=&quot;confirm-the-filesystem-behind-the-path&quot;&gt;Confirm the filesystem behind the path&lt;/h2&gt;

&lt;p&gt;Run the observation inside the affected job environment where possible:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;id
&lt;/span&gt;findmnt &lt;span class=&quot;nt&quot;&gt;-T&lt;/span&gt; /project/example/results
&lt;span class=&quot;nb&quot;&gt;stat&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /project/example/results
&lt;span class=&quot;nb&quot;&gt;df&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt; /project/example/results
&lt;span class=&quot;nb&quot;&gt;df&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; /project/example/results
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The path is illustrative. Compare the resolved mount with the expected filesystem and fileset junction. A missing mount can leave a writable local directory underneath it. A container bind can expose a different path from the one the user sees on the login node.&lt;/p&gt;

&lt;p&gt;A successful local write in that situation is worse than an obvious failure: results may be left on temporary node storage and disappear later. Establish mount identity before using any capacity number to explain the incident.&lt;/p&gt;

&lt;h2 id=&quot;separate-block-capacity-from-file-count-capacity&quot;&gt;Separate block capacity from file-count capacity&lt;/h2&gt;

&lt;p&gt;Storage Scale allocates metadata through inode spaces. Independent filesets have their own inode-space relationships, while dependent filesets share an inode space. That structure matters when interpreting a file-count limit and deciding what change is actually possible.&lt;/p&gt;

&lt;p&gt;Use the installed &lt;a href=&quot;https://www.ibm.com/docs/en/storage-scale/5.2.3?topic=reference-mmlsfileset-command&quot;&gt;mmlsfileset reference&lt;/a&gt; to inspect the relevant fileset and inode information. A generic administrative starting point is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmlsfileset researchfs &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;
mmdf researchfs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;researchfs&lt;/code&gt; is a placeholder. The &lt;a href=&quot;https://www.ibm.com/docs/en/storage-scale/5.2.3?topic=reference-mmdf-command&quot;&gt;mmdf reference&lt;/a&gt; explains the filesystem’s disk and inode-space reporting. Interpret the actual fields for the installed release rather than treating &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;df -i&lt;/code&gt; as a complete description of every fileset’s state.&lt;/p&gt;

&lt;p&gt;An increase in data capacity does not necessarily address an exhausted file-count budget. Conversely, available inodes do not help if the required data or metadata pool cannot allocate space.&lt;/p&gt;

&lt;h2 id=&quot;identify-the-quota-domain-that-rejected-the-work&quot;&gt;Identify the quota domain that rejected the work&lt;/h2&gt;

&lt;p&gt;Inspect user, group and fileset quotas as applicable to the site’s configuration. A project directory name is not proof that only a fileset quota matters. The effective user, group memberships and configured enforcement scopes all participate.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmlsquota &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; researcher researchfs
mmlsquota &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; researchgroup researchfs
mmlsquota &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; project_alpha researchfs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;All names are illustrative. Review IBM’s &lt;a href=&quot;https://www.ibm.com/docs/en/storage-scale/5.2.3?topic=reference-mmlsquota-command&quot;&gt;quota command reference&lt;/a&gt; and &lt;a href=&quot;https://www.ibm.com/docs/en/storage-scale/5.2.3?topic=filesets-quotas&quot;&gt;fileset quota guidance&lt;/a&gt;. Distinguish block limits, inode limits, soft limits, hard limits and grace-period state.&lt;/p&gt;

&lt;p&gt;Do not infer that a larger fileset quota overrides a user or group limit. Identify which scope is binding before proposing a change. If the site enforces user or group quotas per fileset, include that scope in the report so the operator does not adjust the wrong instance.&lt;/p&gt;

&lt;h2 id=&quot;explain-why-directory-size-is-not-authoritative&quot;&gt;Explain why directory size is not authoritative&lt;/h2&gt;

&lt;p&gt;A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;du&lt;/code&gt; result answers a namespace traversal question. It is not automatically equivalent to quota accounting or physical storage consumption. Replication, sparse files, snapshots, deleted-but-open files and the tool’s traversal scope can all make apparently similar numbers describe different things.&lt;/p&gt;

&lt;p&gt;Before comparing them, record units and definitions: logical bytes, allocated blocks, quota charge, retained snapshot data or raw pool consumption. Do not promise that deleting a particular directory will release an identical amount of physical capacity immediately.&lt;/p&gt;

&lt;p&gt;Use supported administrative reporting to investigate mismatches. A quota-accounting check or repair can be substantial work; it should follow the storage team’s procedure and workload assessment rather than be launched reflexively because two commands disagree.&lt;/p&gt;

&lt;h2 id=&quot;look-at-the-pool-and-allocation-policy&quot;&gt;Look at the pool and allocation policy&lt;/h2&gt;

&lt;p&gt;Filesystem-wide free capacity can hide an allocation constraint in a specific pool. Determine where the failing file’s data and metadata are intended to go and compare that with usable headroom and device state.&lt;/p&gt;

&lt;p&gt;A capacity warning should identify the constrained domain. Adding space to a different pool may improve the total while leaving the job unable to write. Likewise, moving data under load is an intervention with its own performance and recovery consequences.&lt;/p&gt;

&lt;p&gt;Separate this investigation from a performance-tuning exercise. If the evidence shows a hard allocation limit, changing cache or transport parameters does not remove it. If capacity is available and the operation is merely slow, investigate latency and contention rather than changing quotas to make the alert disappear.&lt;/p&gt;

&lt;h2 id=&quot;account-for-file-creation-bursts&quot;&gt;Account for file creation bursts&lt;/h2&gt;

&lt;p&gt;A pipeline may create a large temporary file population before producing a modest final result. Examples include extracted archives, per-task logs, package environments, shuffled dataset fragments and container caches. Capacity planning based only on retained output misses that transient peak.&lt;/p&gt;

&lt;p&gt;Measure a representative task’s maximum file count and bytes, then test realistic concurrency. Multiplying the final output size by the number of tasks is not sufficient if intermediate state is much larger.&lt;/p&gt;

&lt;p&gt;Where scientifically appropriate, reduce repeated discovery passes, use a versioned manifest or evaluate a packed data representation. Validate coverage and recovery behavior alongside performance. Replacing millions of files with an archive changes random access, update and partial-recovery characteristics; it is not a free optimization.&lt;/p&gt;

&lt;h2 id=&quot;choose-a-remedy-with-an-owner&quot;&gt;Choose a remedy with an owner&lt;/h2&gt;

&lt;p&gt;A quota increase may be appropriate when the project is entitled to more capacity and the storage system can support it. An inode-space change requires understanding the fileset structure and supported procedure. Cleanup requires a data owner, a retention decision and a bounded candidate set.&lt;/p&gt;

&lt;p&gt;Do not delete broadly by age from a shared tree. Recent access time may not reflect scientific importance, and a temporary-looking directory may contain the only copy of a result. Prepare an inventory, agree the action and validate capacity afterward.&lt;/p&gt;

&lt;p&gt;Close the incident by repeating the failed operation under the original identity and environment. Record the specific binding constraint, the change made and the resulting job behavior. Keep that explanation with the job record so a later write failure can be compared against the same constraint.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/slurm-node-local-scratch-staging-result-publication/&quot;&gt;Node-local scratch under Slurm: stage data without losing the result&lt;/a&gt;, &lt;a href=&quot;/writing/gpfs-multihomed-storage-arp-source-routing/&quot;&gt;GPFS multihomed storage: when ARP filtering hides a second RDMA path&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Linux NVMe multipath and ANA: test the failure boundary the application depends on</title>
    <link href="https://www.wirewalk.com/writing/nvme-multipath-ana-failure-validation/"/>
    <published>2026-10-21T10:00:00-04:00</published>
    <updated>2026-10-21T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nvme-multipath-ana-failure-validation/</id>
    <summary>Map namespace identity and path independence, inspect ANA state, and validate failure and restoration with application-level data checks instead of relying on path counts.</summary>
    <content type="html">&lt;p&gt;Two NVMe paths in an inventory can still share the component whose failure stops the application. They may traverse one adapter, switch, controller or power domain. The path count alone says little about the failure the storage service can tolerate.&lt;/p&gt;

&lt;p&gt;Build the dependency map first, then test the intended failure boundary in an agreed maintenance experiment. Linux native NVMe multipath, controller state, ANA information and the application’s completion behavior all contribute evidence. None is a substitute for the others.&lt;/p&gt;

&lt;p&gt;The examples use Linux and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvme-cli&lt;/code&gt; 2.11-style read-only commands. Transport support, policies and recovery behavior depend on the deployed kernel, distribution and storage product.&lt;/p&gt;

&lt;h2 id=&quot;establish-one-namespace-identity-across-the-paths&quot;&gt;Establish one namespace identity across the paths&lt;/h2&gt;

&lt;p&gt;Start with subsystem and namespace identity, then map the controllers that provide access. Confirm that the paths refer to the same intended logical resource. Do not infer this from matching capacity or similar Linux device names.&lt;/p&gt;

&lt;p&gt;Useful observations include:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvme version
nvme list &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
nvme list-subsys &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
lsblk &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS
findmnt &lt;span class=&quot;nt&quot;&gt;-rn&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; TARGET,SOURCE,FSTYPE
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Retain persistent namespace identifiers and their support context. The &lt;a href=&quot;https://github.com/linux-nvme/nvme-cli/blob/v2.11/Documentation/nvme-list-subsys.txt&quot;&gt;list-subsystems manual&lt;/a&gt; describes the tool view; the storage service’s inventory should establish the identity and ownership behind that view.&lt;/p&gt;

&lt;p&gt;Keep the filesystem or volume’s actual backing device in the map. Application I/O must use the intended aggregated resource rather than an individual path selected accidentally by a setup script.&lt;/p&gt;

&lt;h2 id=&quot;identify-which-layer-owns-multipathing&quot;&gt;Identify which layer owns multipathing&lt;/h2&gt;

&lt;p&gt;Determine whether the service uses Linux native NVMe multipath or another supported stack. Inspect the effective configuration, not just the package list. Avoid layering or disabling path managers without understanding which component currently owns the device.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.kernel.org/admin-guide/nvme-multipath.html&quot;&gt;kernel NVMe multipath guide&lt;/a&gt; describes merging namespace paths and policy selection. Available policies vary across kernel versions. Read the deployed kernel’s documentation and the storage vendor’s support requirements before treating a policy from a current guide as available everywhere.&lt;/p&gt;

&lt;p&gt;For native multipath, a read-only check of the module parameter can help:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/module/nvme_core/parameters/multipath
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Interpret this with kernel configuration and the actual device topology. A missing file or an enabled parameter alone does not establish that the namespace is currently operating through the intended multipath arrangement.&lt;/p&gt;

&lt;h2 id=&quot;interpret-ana-within-the-actual-topology&quot;&gt;Interpret ANA within the actual topology&lt;/h2&gt;

&lt;p&gt;Asymmetric Namespace Access describes access state for namespace groups through controllers. An optimized path and a non-optimized path are not simply two equivalent links with different display labels. The host’s policy must account for the state the subsystem advertises.&lt;/p&gt;

&lt;p&gt;Where supported, inspect the ANA log through the relevant controller:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvme ana-log /dev/nvme0 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/linux-nvme/nvme-cli/blob/v2.11/Documentation/nvme-ana-log.txt&quot;&gt;ANA-log reference&lt;/a&gt; requires a controller character device. Record state and collection time for the relevant paths. Not every device supports the same capability set, and a static snapshot does not describe how quickly a transition becomes visible during failure.&lt;/p&gt;

&lt;p&gt;For NVMe over Fabrics, retain transport endpoints and the network path. For a supported dual-port local configuration, retain PCIe and platform relationships. In both cases, map the shared subsystem that can affect every path at once.&lt;/p&gt;

&lt;h2 id=&quot;define-the-failure-model-before-interrupting-anything&quot;&gt;Define the failure model before interrupting anything&lt;/h2&gt;

&lt;p&gt;Choose the event the service is supposed to tolerate: losing one link, one adapter path, one controller or an entire host is a different test. Identify the exact components affected and which independent route should remain.&lt;/p&gt;

&lt;p&gt;Use a dedicated test namespace or an approved maintenance boundary. Keep a supported recovery method and a stop condition. Do not disconnect a production path merely because a synthetic workload can continue on another node.&lt;/p&gt;

&lt;p&gt;Multipathing provides access-path resilience, not independent copies of the underlying data. If all paths reach the same damaged namespace or failed subsystem, additional host routes do not create a recoverable copy. Keep backup and replication requirements in their own design.&lt;/p&gt;

&lt;h2 id=&quot;measure-the-applications-pause-and-completion-semantics&quot;&gt;Measure the application’s pause and completion semantics&lt;/h2&gt;

&lt;p&gt;Run a bounded workload with known data and a clear integrity check. Record baseline latency, throughput, error handling and write-completion behavior. Define what counts as successful recovery before injecting the event.&lt;/p&gt;

&lt;p&gt;During the agreed failure, retain controller and path transitions, host kernel events and application timing over the same interval. Record the longest observed interruption and whether the application received errors, retried or completed without awareness of the path event.&lt;/p&gt;

&lt;p&gt;Do not count a process remaining alive as a successful failover. It can remain blocked while making no useful progress. Conversely, an application that handles a documented transient error correctly can satisfy a service requirement even though its log is not entirely quiet. Judge the result against the agreed contract.&lt;/p&gt;

&lt;h2 id=&quot;test-restoration-as-carefully-as-failure&quot;&gt;Test restoration as carefully as failure&lt;/h2&gt;

&lt;p&gt;Restore the path through the supported procedure and observe rediscovery, identity and access state. Check that no duplicate or stale device view appears in the storage layers used by the application.&lt;/p&gt;

&lt;p&gt;Allow the workload to continue long enough to inspect the restored operating state. A path that reconnects but repeatedly fails under load is not a stable recovery. Record any changed traffic distribution and compare it with the selected policy’s documented behavior.&lt;/p&gt;

&lt;p&gt;Repeat only the failure cases needed to validate the design. Uncontrolled repeated disconnects can obscure the first failure and add avoidable stress to the service. Preserve the original evidence before conducting a second experiment.&lt;/p&gt;

&lt;h2 id=&quot;keep-recovery-policy-consistent-with-workload-needs&quot;&gt;Keep recovery policy consistent with workload needs&lt;/h2&gt;

&lt;p&gt;Review timeout, reconnect and controller-loss behavior as a combined policy with the storage vendor. A setting that shortens one test’s pause may cause an application to receive errors earlier during a legitimate recovery event.&lt;/p&gt;

&lt;p&gt;Use the workload’s tolerance and data semantics to choose a supported configuration. Avoid copying timeout values from a different transport or changing a machine-wide policy to improve a single benchmark without assessing other consumers.&lt;/p&gt;

&lt;p&gt;Keep the qualified configuration and test result with the node image or service release. Recheck relevant behavior after kernel, firmware or storage-controller changes. For the controller software side, use &lt;a href=&quot;/writing/nvme-firmware-slots-activation-maintenance/&quot;&gt;NVMe firmware lifecycle management&lt;/a&gt;; for the identity map every test depends on, see &lt;a href=&quot;/writing/nvme-controller-namespace-identity-management/&quot;&gt;controller and namespace inventory&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Progress estimates over unevenly sized work are wrong by construction</title>
    <link href="https://www.wirewalk.com/writing/progress-estimates-unevenly-sized-work/"/>
    <published>2026-10-14T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/progress-estimates-unevenly-sized-work/</id>
    <summary>Completion order correlates with size, so the first items to finish are the small ones. Any rate extrapolated from early completions is biased, and on a long transfer it can be wrong by more than an order of magnitude.</summary>
    <content type="html">&lt;p&gt;Mid-way through a long job, someone asks how long it has left. There is a number available —
items done over elapsed time, extrapolated — and it is usually wrong in a specific, predictable
direction.&lt;/p&gt;

&lt;p&gt;A concrete case. A verification pass over a large object store reported, from its first seven
completed objects, a rate of about &lt;strong&gt;660 MB/s&lt;/strong&gt; and an estimate of &lt;strong&gt;26 hours&lt;/strong&gt;. The completed
pass ran at &lt;strong&gt;11.4 GiB/s&lt;/strong&gt; and finished in &lt;strong&gt;88 minutes&lt;/strong&gt;. Wrong by roughly 17x, pessimistic.&lt;/p&gt;

&lt;p&gt;Nothing was broken, and the arithmetic was right. The sample was biased by construction.&lt;/p&gt;

&lt;h2 id=&quot;why-the-early-sample-is-always-unrepresentative&quot;&gt;Why the early sample is always unrepresentative&lt;/h2&gt;

&lt;p&gt;If items are processed concurrently and they differ in size, the ones that complete first are
disproportionately the small ones. That is not bad luck; it is what “finishes first” means. So
at any early moment, the completed set is a size-biased sample of the work, and the mean item
duration computed over it understates the remaining mean.&lt;/p&gt;

&lt;p&gt;Two consequences, in opposite directions, depending on what you divide by:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Items per second&lt;/strong&gt; extrapolated from early completions is &lt;strong&gt;too fast&lt;/strong&gt; — you will promise
an early finish and miss it, because the large items are all still ahead of you.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Bytes per second&lt;/strong&gt; computed as (bytes done / elapsed) while large items are in flight is
&lt;strong&gt;too slow&lt;/strong&gt; — the bytes already read inside incomplete items are not counted anywhere, so
the numerator is missing most of the work actually performed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The 17x error above is the second kind: twenty-four multi-terabyte objects were being read
concurrently, and none had completed, so none of their bytes were in the numerator.&lt;/p&gt;

&lt;h2 id=&quot;count-the-work-in-the-unit-the-work-is-actually-in&quot;&gt;Count the work in the unit the work is actually in&lt;/h2&gt;

&lt;p&gt;The fix is not a better estimator. It is a better denominator.&lt;/p&gt;

&lt;p&gt;For a transfer or a scan, the total is &lt;strong&gt;known in bytes before you start&lt;/strong&gt; — a listing gives
you sizes. So progress should be byte-weighted:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;percent = bytes_completed / bytes_total
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and the rate should come from a &lt;strong&gt;windowed delta&lt;/strong&gt; of a monotonic byte counter, not from a
cumulative average since start:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rate = (bytes_at_t2 - bytes_at_t1) / (t2 - t1)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The cumulative average answers “what has the average rate been”, which is not the question. The
question is “what is the rate now”, because that is what multiplies the remaining bytes.&lt;/p&gt;

&lt;p&gt;If the tool can report in-progress bytes per item — many can, via a temp-file size or its own
progress output — count them. If it cannot, acknowledge the floor explicitly: with N large items
in flight and no partial accounting, your byte counter is a lower bound and your rate is a lower
bound, and you should present them as such rather than as an estimate.&lt;/p&gt;

&lt;h2 id=&quot;counters-are-not-rates&quot;&gt;Counters are not rates&lt;/h2&gt;

&lt;p&gt;This is the same error in a different costume, and it is endemic in homegrown dashboards. A
counter exposed as a gauge gets plotted as a line that climbs forever, and someone reads the
height of the line as throughput.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-promql&quot;&gt;# wrong: a monotonically increasing total, rendered as if it were a rate
transfer_bytes_total

# right
rate(transfer_bytes_total[5m])
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The corollary that bites later: a process restart resets the counter, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rate()&lt;/code&gt; handles that
correctly, and a hand-rolled &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(now - previous) / interval&lt;/code&gt; does not — it produces a large
negative number that the panel renders as a dropout. If you are computing deltas yourself,
clamp at zero and treat a reset as a gap rather than a value.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-stalled-from-slow-because-they-need-different-responses&quot;&gt;Distinguish stalled from slow, because they need different responses&lt;/h2&gt;

&lt;p&gt;“Percent complete is not moving” has at least four causes, and the dashboard should separate
them:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Observation&lt;/th&gt;
      &lt;th&gt;Meaning&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;byte counter rising, item counter static&lt;/td&gt;
      &lt;td&gt;Working normally on large items&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;byte counter static, workers present&lt;/td&gt;
      &lt;td&gt;Stalled — blocked on I/O, lock, or remote end&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;both static, no workers&lt;/td&gt;
      &lt;td&gt;Exited; check why, and whether it is restartable&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;item counter rising, byte counter barely moving&lt;/td&gt;
      &lt;td&gt;Grinding through many small items; metadata-bound&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The third row is the only one that needs a human immediately, and the first row is the one most
often mistaken for the second. A single percent-complete number cannot tell them apart, which
is the practical argument for publishing the two counters separately rather than only their
ratio.&lt;/p&gt;

&lt;p&gt;Add one more signal that costs nothing and resolves most ambiguity: &lt;strong&gt;time since last
completion&lt;/strong&gt;, and &lt;strong&gt;time since the byte counter last changed&lt;/strong&gt;. A job with 40 minutes since its
last completed item but a byte counter that moved four seconds ago is healthy and working on
something big.&lt;/p&gt;

&lt;h2 id=&quot;reporting-rate-honestly&quot;&gt;Reporting rate honestly&lt;/h2&gt;

&lt;p&gt;Three rules that have survived contact with people who make decisions on these numbers:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Never report a rate computed from fewer completions than you have concurrent workers.&lt;/strong&gt;
With 24 workers and 7 completions, there is no rate yet. “Running, N items complete, no
reliable rate until the large items land” is a better answer than a number.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Report the window.&lt;/strong&gt; “11.4 GiB/s over the full 88-minute pass” and “660 MB/s over the
first four minutes” are both true and mean completely different things. A rate without its
window is not checkable.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;State the unit of the denominator.&lt;/strong&gt; Percent of items and percent of bytes diverge
enormously on skewed data — one object in a thousand can be most of the dataset.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And the discipline behind all three: if an estimate is going to be repeated to someone else,
say what it is extrapolated from. The 26-hour figure was not dishonest; it was an extrapolation
from seven small objects, and had it been reported that way nobody would have planned around it.&lt;/p&gt;

&lt;h2 id=&quot;a-note-on-the-same-bias-in-scheduling-and-benchmarks&quot;&gt;A note on the same bias in scheduling and benchmarks&lt;/h2&gt;

&lt;p&gt;The pattern is not specific to transfers.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Scheduler backfill&lt;/strong&gt;: the jobs that start first are the small ones that fit the gaps, so
queue-wait statistics computed over completed jobs understate the wait for large jobs. Segment
by size class or the metric is an average of two different populations.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Synchronized benchmarks&lt;/strong&gt;: a collective finishes when its slowest participant finishes, so a
mean over ranks tells you very little and one degraded node sets the result for the whole run.
Check the distribution, and check every participant’s link before trusting a number.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Index or scan jobs over a filesystem&lt;/strong&gt;: directory entry counts are wildly skewed, so
“directories processed” is close to meaningless as progress. Weight by entries.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Cause&lt;/th&gt;
      &lt;th&gt;Fix&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;ETA shortens then balloons&lt;/td&gt;
      &lt;td&gt;Item-count extrapolation, small items first&lt;/td&gt;
      &lt;td&gt;byte-weighted progress&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Reported rate far below hardware capability&lt;/td&gt;
      &lt;td&gt;Large items in flight, partial bytes uncounted&lt;/td&gt;
      &lt;td&gt;windowed delta; count partials or state the floor&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Rate graph shows a cliff to negative&lt;/td&gt;
      &lt;td&gt;Counter reset computed by hand&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rate()&lt;/code&gt;, or clamp and treat as a gap&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Percent static, job healthy&lt;/td&gt;
      &lt;td&gt;One large item in progress&lt;/td&gt;
      &lt;td&gt;publish bytes and items separately&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Early estimate repeated as a commitment&lt;/td&gt;
      &lt;td&gt;Rate reported without its window&lt;/td&gt;
      &lt;td&gt;always report the window and the sample size&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Measure progress in the unit that drives the work—bytes for a transfer, for example—and report the rate window. If large items are still in flight and partial progress is unavailable, label the estimate as provisional or wait for a more representative sample.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lustre operations: metadata, target imbalance and AI pipeline stalls</title>
    <link href="https://www.wirewalk.com/writing/lustre-metadata-capacity-performance-operations/"/>
    <published>2026-10-11T00:00:00-04:00</published>
    <updated>2026-10-18T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/lustre-metadata-capacity-performance-operations/</id>
    <summary>Investigate Lustre metadata latency, per-target capacity, slow clients and AI pipeline stalls with scoped checks, workload evidence, and an operations handoff.</summary>
    <content type="html">&lt;p&gt;If a Lustre job stalls despite available capacity, find out which operation is waiting. File creation, data transfer and a delayed training rank lead to different checks. A successful mount and a comfortable filesystem total leave all of those questions open.&lt;/p&gt;

&lt;p&gt;The sequence below follows metadata, target distribution and client behavior against the application’s timing. These are proposed diagnostic checks, not an account of a production incident.&lt;/p&gt;

&lt;h2 id=&quot;start-with-the-affected-operation-and-time-window&quot;&gt;Start with the affected operation and time window&lt;/h2&gt;

&lt;p&gt;Ask whether the job is delayed opening files, listing directories, reading samples, writing checkpoints or closing output. Record the job allocation, affected clients and a precise interval.&lt;/p&gt;

&lt;p&gt;Collect recent errors and client/server state using the site’s established monitoring and support procedures. Preserve evidence before restarting services. A restart can remove symptoms and the information needed to explain them, while introducing recovery work for other clients.&lt;/p&gt;

&lt;p&gt;Compare affected and unaffected jobs with similar access patterns. A read-heavy training run and a metadata-heavy preprocessing job are not interchangeable controls.&lt;/p&gt;

&lt;h2 id=&quot;check-capacity-at-target-granularity&quot;&gt;Check capacity at target granularity&lt;/h2&gt;

&lt;p&gt;A bounded read-only starting point is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lfs &lt;span class=&quot;nb&quot;&gt;df&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt; /path/to/lustre
lfs &lt;span class=&quot;nb&quot;&gt;df&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; /path/to/lustre
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Interpret output with the installed release’s documentation and the storage team. Capacity in bytes and inode availability answer different questions. Per-target state matters; a reassuring total does not prove that a specific allocation or layout has usable headroom.&lt;/p&gt;

&lt;p&gt;The project’s &lt;a href=&quot;https://wiki.lustre.org/Understanding_Lustre_Internals&quot;&gt;Lustre internals overview&lt;/a&gt; explains the separation of metadata and object-storage components and the role of client tools. Use that separation to choose which metrics to investigate rather than treating the filesystem as one disk.&lt;/p&gt;

&lt;h2 id=&quot;identify-metadata-heavy-pipeline-behavior&quot;&gt;Identify metadata-heavy pipeline behavior&lt;/h2&gt;

&lt;p&gt;Repeated recursive scans, many tiny files, repeated existence checks and simultaneous job startup can create substantial metadata work without large byte counts. Inspect the application’s behavior before assuming that more data bandwidth will help.&lt;/p&gt;

&lt;p&gt;Use a sampled, representative namespace and controlled concurrency for measurement. Avoid repeatedly walking the full production tree as a diagnostic shortcut; the check itself adds work to the system being investigated.&lt;/p&gt;

&lt;p&gt;Potential application changes include using a precomputed manifest, avoiding duplicate discovery passes and evaluating a sharded dataset format. Validate correctness, sample coverage and update behavior along with speed. A stale manifest that silently omits new data is a pipeline defect.&lt;/p&gt;

&lt;h2 id=&quot;inspect-file-layout-and-target-load-together&quot;&gt;Inspect file layout and target load together&lt;/h2&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lfs getstripe&lt;/code&gt; on a small representative set of files and compare those layouts with target-level load during the affected interval. Do not infer data placement solely from the directory name or current default.&lt;/p&gt;

&lt;p&gt;Lustre’s &lt;a href=&quot;https://wiki.lustre.org/Configuring_Lustre_File_Striping&quot;&gt;file layout documentation&lt;/a&gt; explains layout inspection and defaults for new files. A proposal to relocate existing data needs a separate plan: supported tooling, available space, expected load, interruption behavior and rollback or recovery.&lt;/p&gt;

&lt;p&gt;Target imbalance may explain a result, but the same symptom can come from application serialization or a client bottleneck. Confirm that the busy target is on the critical path before changing placement.&lt;/p&gt;

&lt;h2 id=&quot;follow-the-slowest-training-rank&quot;&gt;Follow the slowest training rank&lt;/h2&gt;

&lt;p&gt;In distributed AI jobs, record loader wait and step duration by rank. A single delayed participant can determine when the whole job reaches its next synchronization point. Compare that rank’s CPU allocation, preprocessing, memory pressure, filesystem access and network counters with its peers.&lt;/p&gt;

&lt;p&gt;Use interval counter changes and aligned timestamps. A large historical error total is less useful than evidence that errors increased while the job stalled. Likewise, healthy cluster-wide throughput does not rule out one client’s delayed requests.&lt;/p&gt;

&lt;p&gt;Test a prepared batch to separate model execution from input delivery. If the model remains slow without storage reads, pursue compute, communication or software configuration before tuning the filesystem.&lt;/p&gt;

&lt;h2 id=&quot;hand-off-an-actionable-operational-record&quot;&gt;Hand off an actionable operational record&lt;/h2&gt;

&lt;p&gt;A good storage escalation includes job IDs, timestamps, affected operations, representative paths safe to share, client versions, file layouts, per-target capacity and load, errors and the exact reproduction scope. Redact research data and credentials.&lt;/p&gt;

&lt;p&gt;For a planned fix, define the expected improvement and the guardrails: application throughput, tail latency, impact on neighboring jobs and recovery state. Stop if the intervention compromises availability or exceeds its agreed scope.&lt;/p&gt;

&lt;p&gt;After the change, repeat the same workload and compare its throughput, tail latency and errors. Keep any remaining slowdown visible in the handoff.&lt;/p&gt;

&lt;p&gt;Read next: &lt;a href=&quot;/writing/lustre-striping-ai-hpc-workloads/&quot;&gt;Lustre stripe layout experiments&lt;/a&gt;, &lt;a href=&quot;/writing/pytorch-dataloader-bottlenecks-hpc-gpu-training/&quot;&gt;PyTorch loader diagnosis&lt;/a&gt;, and &lt;a href=&quot;/writing/distributed-ai-checkpoint-storage-restart-testing/&quot;&gt;distributed checkpoint recovery&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>AMD GPU debugging and hardware analysis with ROCgdb, rocprofv3 and ROCm Compute Profiler</title>
    <link href="https://www.wirewalk.com/writing/amd-rocm-rocgdb-rocprofv3-gpu-analysis/"/>
    <published>2026-10-08T10:00:00-04:00</published>
    <updated>2026-10-08T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/amd-rocm-rocgdb-rocprofv3-gpu-analysis/</id>
    <summary>Build an AMD GPU investigation from a HIP reproducer to wavefront debugging, timeline tracing and architecture-specific cache and compute analysis, then verify the result outside the tools.</summary>
    <content type="html">&lt;p&gt;A HIP application can be slow because the host launches work late, the GPU spends time moving data, a kernel issues inefficient accesses or a correctness defect causes retries and abnormal execution. These cases can all produce an unhelpful description: the GPU is not performing well.&lt;/p&gt;

&lt;p&gt;Build the investigation in stages. Preserve a reproducer, establish correctness, inspect the application timeline, then collect targeted hardware evidence. ROCgdb, rocprofv3 and ROCm Compute Profiler have complementary roles; their reports should remain tied to the software version and AMD GPU architecture that produced them.&lt;/p&gt;

&lt;p&gt;This workflow uses documented ROCm 6.4-era facilities as a baseline. It does not assume that every later profiling feature, accelerator family or device-debug capability is available in that release.&lt;/p&gt;

&lt;h2 id=&quot;capture-the-actual-host-and-device-environment&quot;&gt;Capture the actual host and device environment&lt;/h2&gt;

&lt;p&gt;Record the GPU architecture and identity, kernel driver, ROCm runtime, compiler, communication libraries and application build. Include the container and launch command when those participate in the workload.&lt;/p&gt;

&lt;p&gt;Check support for the exact device, operating system and tool combination. A runtime that can execute a program does not automatically establish support for every debugger or hardware-counter feature. Device access and profiling permissions also depend on the host’s configuration, even when the tools are installed in a container.&lt;/p&gt;

&lt;p&gt;Reduce the input while preserving the failing or slow behavior. Keep an output check so a performance experiment cannot silently compare different computations. For floating-point work, define an appropriate correctness criterion rather than assuming byte-identical results are always required.&lt;/p&gt;

&lt;p&gt;Use the supported &lt;a href=&quot;https://rocm.docs.amd.com/projects/amdsmi/en/docs-6.4.0/how-to/amdsmi-cli-tool.html&quot;&gt;AMD SMI telemetry interface&lt;/a&gt; to retain device identity and operating context before and during the experiment. Basic read-only snapshots can start with:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;amd-smi version
amd-smi list
amd-smi metric
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Available fields depend on the platform. Align clock, power, temperature and activity observations with the application interval. These readings can expose an operating constraint, but do not identify which kernel instruction or cache access caused a stall. Avoid mixing a whole-device activity percentage with a per-kernel counter as though they had the same scope.&lt;/p&gt;

&lt;h2 id=&quot;debug-a-small-hip-case-before-profiling-it&quot;&gt;Debug a small HIP case before profiling it&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://rocm.docs.amd.com/projects/ROCgdb/en/docs-6.4.0/how-to/quick-start.html&quot;&gt;ROCgdb 6.4 quick start&lt;/a&gt; describes building with debug information and using host and device views. An illustrative setup is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hipcc &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-O0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; hip-debug solver.cpp
rocgdb ./hip-debug
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Keep the application’s required target and link flags in the real build. A separate optimized executable should preserve the original behavior for later validation.&lt;/p&gt;

&lt;p&gt;Set a breakpoint in a meaningful host or kernel source location, run the reproducer and inspect its context. Device threads in ROCgdb represent wavefronts rather than a list of independent HIP work items. Select the relevant wavefront and lane context using the documented controls before interpreting variables or registers.&lt;/p&gt;

&lt;p&gt;Inspect address calculations, bounds, lifetime and synchronization. A host stack at a synchronization call may be observing an earlier device failure. Adding synchronization can help localize the interval, but changes timing and should remain a clearly identified diagnostic modification.&lt;/p&gt;

&lt;h2 id=&quot;keep-debugging-effects-separate-from-the-remedy&quot;&gt;Keep debugging effects separate from the remedy&lt;/h2&gt;

&lt;p&gt;A bug disappearing at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-O0&lt;/code&gt; or under a breakpoint does not establish that the optimized code is correct. Instrumentation and changed code generation alter scheduling, allocation and timing.&lt;/p&gt;

&lt;p&gt;Preserve the original optimized case and add a targeted check around the suspected contract. If the cause is premature reuse, identify which completion dependency protects the buffer. If the cause is an invalid index, connect the failing work item to its input and launch geometry.&lt;/p&gt;

&lt;p&gt;Read the &lt;a href=&quot;https://rocm.docs.amd.com/projects/ROCgdb/en/docs-6.4.0/ROCgdb/gdb/doc/gdb/AMD-GPU.html&quot;&gt;versioned AMD GPU debugging limitations&lt;/a&gt; before promising support for a particular architecture or execution feature. Do not bypass host security policy or expose all devices in a shared environment merely to get the debugger to attach.&lt;/p&gt;

&lt;h2 id=&quot;trace-the-application-before-selecting-counters&quot;&gt;Trace the application before selecting counters&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://rocm.docs.amd.com/projects/rocprofiler-sdk/en/docs-6.4.0/how-to/using-rocprofv3.html&quot;&gt;ROCprofiler-SDK 6.4 rocprofv3 guide&lt;/a&gt; documents separate tracing choices. A bounded example is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rocprofv3 &lt;span class=&quot;nt&quot;&gt;--hip-trace&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--kernel-trace&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--memory-copy-trace&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--output-format&lt;/span&gt; csv &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt; ./hip-solver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The application is a placeholder. Limit the reproducer’s duration and keep output paths unique between attempts. The command is intended to expose API, kernel and copy timing; it is not a complete hardware-counter analysis.&lt;/p&gt;

&lt;p&gt;Inspect launch gaps, data transfers and kernel execution over the same application phase. Use supported markers when source instrumentation can provide useful phase names. A long host API call and a long kernel are different observations and should not be merged into a generic GPU wait total.&lt;/p&gt;

&lt;h2 id=&quot;narrow-hardware-collection-to-a-meaningful-kernel&quot;&gt;Narrow hardware collection to a meaningful kernel&lt;/h2&gt;

&lt;p&gt;Choose the kernel and invocation from the trace, including its problem size and warm-up state. Then use the installed version’s supported counter collection or ROCm Compute Profiler workflow for that device.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://rocm.docs.amd.com/projects/rocprofiler-compute/en/docs-6.4.2/how-to/profile/mode.html&quot;&gt;ROCm Compute Profiler’s versioned profile guide&lt;/a&gt; describes counter collection and analysis capabilities. Confirm architecture support and replay behavior before using a predefined analysis. A report with a familiar panel name does not guarantee equivalent hardware events across GPU generations.&lt;/p&gt;

&lt;p&gt;Multiple passes can change timing and cache context. Record the collection method, selection filters and number of passes where available. Do not claim that a serialized or replayed measurement preserves all overlap and contention from normal concurrent execution.&lt;/p&gt;

&lt;h2 id=&quot;read-cache-lds-and-compute-observations-together&quot;&gt;Read cache, LDS and compute observations together&lt;/h2&gt;

&lt;p&gt;Distinguish global-memory traffic, cache activity, Local Data Share usage and register-related constraints. LDS is a different resource from a hardware-managed cache. An optimization that moves data into LDS changes explicit storage and synchronization requirements as well as access latency.&lt;/p&gt;

&lt;p&gt;A cache-hit ratio needs its request population and hierarchy level. High hit rates can coexist with inefficient request patterns; low rates can be normal for streaming data. Compare bytes moved and useful output, with architecture-specific definitions retained.&lt;/p&gt;

&lt;p&gt;Inspect wavefront residency and register demand without treating maximum occupancy as the objective. Extra resident work can hide latency, while a change that forces spilling or increases synchronization can make the kernel slower. Use a supported roofline analysis only when the operation count, traffic definition and relevant ceilings are understood.&lt;/p&gt;

&lt;h2 id=&quot;re-run-the-full-application-under-ordinary-conditions&quot;&gt;Re-run the full application under ordinary conditions&lt;/h2&gt;

&lt;p&gt;After a code or layout change, check correctness and measure the uninstrumented executable using matched input, placement and allocation. Alternate selected comparisons to expose warm-up and background variation.&lt;/p&gt;

&lt;p&gt;For distributed workloads, repeat the communication path and examine whether a faster local kernel changes collective waiting or transfer overlap. A single-device result does not establish an improvement for the whole job.&lt;/p&gt;

&lt;p&gt;Save the reproducer, tool versions, device architecture, report configuration, proposed cause and final application outcome. For the CPU side of a heterogeneous pipeline, see &lt;a href=&quot;/writing/amd-uprof-ibs-core-cache-numa-analysis/&quot;&gt;AMD uProf and IBS analysis&lt;/a&gt;. A useful hardware report explains where the application spends time and which controlled change improved its work.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>The scheduled job did not stop running, it stopped reporting</title>
    <link href="https://www.wirewalk.com/writing/the-scheduled-job-that-stopped-reporting/"/>
    <published>2026-10-08T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/the-scheduled-job-that-stopped-reporting/</id>
    <summary>A cron job that redirects its own output has disabled the only notification channel cron has. Add a second copy of the crontab that nobody is reading and you have a job whose behaviour cannot be deduced from its configuration.</summary>
    <content type="html">&lt;p&gt;When a scheduled job stops reporting, its notification mechanism may be part of the failure. The three cases below leave configuration that looks plausible while the running job behaves differently—or never runs at all.&lt;/p&gt;

&lt;h2 id=&quot;1-the-script-that-silences-its-own-notifications&quot;&gt;1. The script that silences its own notifications&lt;/h2&gt;

&lt;p&gt;cron’s notification model is simple and entirely output-driven: &lt;strong&gt;if a job writes anything to
stdout or stderr, cron mails that output to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MAILTO&lt;/code&gt;.&lt;/strong&gt; Silence means success. There is no exit
status handling, no retry, no alert — output or nothing.&lt;/p&gt;

&lt;p&gt;So a script whose first act is to redirect its own output has turned the notifier off:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /var/log/replication.log 2&amp;gt;&amp;amp;1      &lt;span class=&quot;c&quot;&gt;# cron will now never have anything to mail&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is a sensible thing to want — you do want a log — and it is usually added long after the
cron entry, by someone who is not thinking about cron. The job then fails every night for
months, writing its failure faithfully into a log file nobody opens, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MAILTO&lt;/code&gt; stays quiet
because quiet is what success looks like.&lt;/p&gt;

&lt;p&gt;The fix is to put the condition in the &lt;strong&gt;crontab line&lt;/strong&gt;, where cron can see it:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-cron&quot;&gt;30 3 * * * root /usr/local/sbin/replicate.sh || echo &quot;replicate.sh FAILED rc=$? on $(hostname)&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now a non-zero exit produces output, and output produces mail. The script keeps its log; cron
regains its channel. Same idea for a timer, via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OnFailure=&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nn&quot;&gt;[Unit]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;OnFailure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;notify-failure@%n.service&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A related subtlety: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set -e&lt;/code&gt; plus a pipeline means the exit status is the &lt;strong&gt;last&lt;/strong&gt; command’s,
so &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmsomething | tee log&lt;/code&gt; exits zero when the first element fails. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set -o pipefail&lt;/code&gt; or
explicit status checks, or the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;||&lt;/code&gt; above never fires.&lt;/p&gt;

&lt;h2 id=&quot;2-the-configuration-you-are-reading-is-not-the-configuration-in-force&quot;&gt;2. The configuration you are reading is not the configuration in force&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/cron.d&lt;/code&gt; is a drop-in directory and cron reads &lt;strong&gt;every&lt;/strong&gt; file in it. Which means a
superseded copy left beside the current one is still a live crontab.&lt;/p&gt;

&lt;p&gt;The failure shape: someone pauses a nightly job by commenting out its line, and the job keeps
running on schedule. Reading the current file shows a commented-out, disabled job. The job is
driven by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;replication.cron.bak-20260812&lt;/code&gt;, sitting in the same directory, containing the
uncommented version — and if that copy ends its line with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;/code&gt;, it is also
invisible to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MAILTO&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You cannot deduce this from the file you edited. You have to ask the directory:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# every active line cron will actually act on, from every file&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rhE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;^[^#[:space:]]&apos;&lt;/span&gt; /etc/cron.d/ /etc/crontab 2&amp;gt;/dev/null | &lt;span class=&quot;nb&quot;&gt;sort
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;u &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;: &lt;span class=&quot;nt&quot;&gt;-f1&lt;/span&gt; /etc/passwd&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;crontab &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$u&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;s/^/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$u&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;: /&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then verify against what the daemon reports doing, which is the only authority:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;journalctl &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; crond &lt;span class=&quot;nt&quot;&gt;--since&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-25h&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;CMD | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;uniq&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If a command appears in the journal that does not appear in your inventory, you have found a
file you did not know about. If a command appears twice an hour and the configuration says
once, there are two files.&lt;/p&gt;

&lt;h2 id=&quot;3-the-unit-that-reports-enabled-and-does-nothing&quot;&gt;3. The unit that reports enabled and does nothing&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemctl is-enabled&lt;/code&gt; answers a question about symlinks, not about effect. The common way to
get a unit that is enabled, exits successfully, and accomplishes nothing persistent:&lt;/p&gt;

&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nn&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;oneshot&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/bin/mount --bind /gpfs/scratch /scratch&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/bin/umount /scratch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RemainAfterExit=yes&lt;/code&gt;, a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Type=oneshot&lt;/code&gt; service is considered &lt;strong&gt;inactive&lt;/strong&gt; the moment
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ExecStart&lt;/code&gt; returns — and systemd then runs &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ExecStop&lt;/code&gt;, because the unit is transitioning out of
active. The bind mount is created and immediately removed. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemctl start&lt;/code&gt; returns success;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;is-enabled&lt;/code&gt; says enabled; the mount is not there.&lt;/p&gt;

&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nn&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;oneshot&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;RemainAfterExit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The check that catches it is not &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;is-enabled&lt;/code&gt;, it is asserting the intended end state:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl start scratch-bind.service
findmnt &lt;span class=&quot;nt&quot;&gt;--target&lt;/span&gt; /scratch &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;/dev/null &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;present &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ABSENT - unit ran, nothing persisted&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;make-the-job-prove-it-ran&quot;&gt;Make the job prove it ran&lt;/h2&gt;

&lt;p&gt;The common thread: every one of these is a job whose status is inferred rather than observed.
The cure is for each scheduled job to leave evidence that an independent check can read, and
for something to alert on the &lt;strong&gt;absence&lt;/strong&gt; of that evidence.&lt;/p&gt;

&lt;p&gt;A small, durable pattern:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# at the end of a successful run&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;STAMP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/var/lib/jobstate/replicate
&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;%s rc=0 bytes=%s\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Is&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$BYTES&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$STAMP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then publish staleness as a metric and alert on it. For a host already running node_exporter,
the textfile collector is the cheapest route:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;job_last_success_timestamp_seconds{job=&quot;replicate&quot;} %s\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; +%s&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /var/lib/node_exporter/textfile_collector/replicate.prom.&lt;span class=&quot;nv&quot;&gt;$$&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /var/lib/node_exporter/textfile_collector/replicate.prom.&lt;span class=&quot;nv&quot;&gt;$$&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
           /var/lib/node_exporter/textfile_collector/replicate.prom
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;pre&gt;&lt;code class=&quot;language-promql&quot;&gt;time() - job_last_success_timestamp_seconds{job=&quot;replicate&quot;} &amp;gt; 93600
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Three properties make this worth the ten lines. It is &lt;strong&gt;positive evidence&lt;/strong&gt; — written only on
success, so it cannot be produced by a crashed run. It &lt;strong&gt;detects not-running&lt;/strong&gt;, which
output-driven notification structurally cannot: a job that never starts produces no output and
therefore no mail. And it is &lt;strong&gt;readable by something other than the job&lt;/strong&gt;, which is the only way
to escape the trap where the failing component is also the reporting component.&lt;/p&gt;

&lt;h2 id=&quot;checking-a-schedule-you-have-inherited&quot;&gt;Checking a schedule you have inherited&lt;/h2&gt;

&lt;p&gt;Six commands, in the order that finds things fastest:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;journalctl -u crond --since -25h | grep CMD&lt;/code&gt; — what actually ran.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -rhE &apos;^[^#[:space:]]&apos; /etc/cron.d/ /etc/crontab&lt;/code&gt; — what is configured, from every file.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls -la /etc/cron.d/&lt;/code&gt; — look for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bak&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.orig&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~&lt;/code&gt;, dated copies.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemctl list-timers --all&lt;/code&gt; — the other scheduler, often forgotten entirely.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -l &apos;exec *&amp;gt;&apos; /usr/local/sbin/*&lt;/code&gt; — scripts that have silenced themselves.&lt;/li&gt;
  &lt;li&gt;For each job: where is its evidence of success, and what alerts on the absence of it?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Question 6 is the one that usually has no answer, and it is the one that matters.&lt;/p&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Cause&lt;/th&gt;
      &lt;th&gt;Check&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Job failing for weeks, no mail&lt;/td&gt;
      &lt;td&gt;Script redirects own stdout/stderr&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep &apos;exec *&amp;gt;&apos;&lt;/code&gt;; move the test into the crontab line&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;“Paused” job still running&lt;/td&gt;
      &lt;td&gt;Second crontab in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/cron.d&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls -la /etc/cron.d/&lt;/code&gt;, journal CMD lines&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Runs twice per schedule&lt;/td&gt;
      &lt;td&gt;Duplicate drop-in files&lt;/td&gt;
      &lt;td&gt;journal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;uniq -c&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Unit enabled, effect absent&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Type=oneshot&lt;/code&gt; without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RemainAfterExit&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;assert end state, not &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;is-enabled&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Pipeline failure reported as success&lt;/td&gt;
      &lt;td&gt;Exit status of a pipeline is the last element&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set -o pipefail&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Nobody noticed for months&lt;/td&gt;
      &lt;td&gt;Nothing alerts on absence&lt;/td&gt;
      &lt;td&gt;success stamp + staleness alert&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Have an independent check watch for the last successful run and alert when it becomes stale. That covers a job that vanished entirely as well as one whose own notification path failed.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Who pays for the egress: establish it behaviourally, not from the console</title>
    <link href="https://www.wirewalk.com/writing/who-pays-for-egress-establish-it-behaviourally/"/>
    <published>2026-10-03T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/who-pays-for-egress-establish-it-behaviourally/</id>
    <summary>Before pulling tens of terabytes out of someone else&apos;s bucket, you want to know whose invoice it lands on. The configuration API that would answer the question is usually denied to you — but the behaviour of a single GET answers it definitively.</summary>
    <content type="html">&lt;p&gt;Before copying tens of terabytes from a collaborator’s bucket, agree who will pay for the transfer. Your access grant may allow downloads while denying the configuration call that would show the bucket’s payment setting.&lt;/p&gt;

&lt;p&gt;A small, authorized request can help establish the required behavior before the full transfer starts.&lt;/p&gt;

&lt;h2 id=&quot;the-configuration-call-you-cannot-make&quot;&gt;The configuration call you cannot make&lt;/h2&gt;

&lt;p&gt;Requester Pays is a bucket-level setting, and there is an API for reading it:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws s3api get-bucket-request-payment &lt;span class=&quot;nt&quot;&gt;--bucket&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$B&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;An error occurred (AccessDenied) when calling the GetBucketRequestPayment operation
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is the normal outcome when your access was granted at the object level. Reading bucket
configuration requires permissions on the bucket resource that a data-sharing grant does not
include, and there is no reason for the owner to have given them to you. So the authoritative
source is closed.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AccessDenied&lt;/code&gt; here tells you nothing about the setting. It is not evidence either way.&lt;/p&gt;

&lt;h2 id=&quot;the-behaviour-is-the-test&quot;&gt;The behaviour is the test&lt;/h2&gt;

&lt;p&gt;The specification gives you a clean experiment. When a bucket has Requester Pays enabled, S3
&lt;strong&gt;rejects&lt;/strong&gt; any request that does not carry the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x-amz-request-payer: requester&lt;/code&gt; header, with&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;That rejection is not optional and not configurable — its entire purpose is to stop a
requester being billed without having acknowledged it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Therefore:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# deliberately WITHOUT --request-payer&lt;/span&gt;
aws s3api head-object &lt;span class=&quot;nt&quot;&gt;--bucket&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$B&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--key&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SMALL_KEY&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;NOT requester-pays&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A request that succeeds &lt;strong&gt;without&lt;/strong&gt; the header proves the bucket is not Requester Pays, because
if it were, that request would have been refused. One small object, one call, a definitive
answer about a multi-terabyte transfer.&lt;/p&gt;

&lt;p&gt;Run it the other way for completeness and the result is uninformative: adding
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--request-payer requester&lt;/code&gt; to a bucket that does not require it is simply accepted, so success
with the header tells you nothing. The informative case is the bare request.&lt;/p&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;head-object&lt;/code&gt;, not &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;get-object&lt;/code&gt;, and use the smallest object you can find. You want the
cheapest possible probe, and you do not want the probe itself to be a meaningful transfer.&lt;/p&gt;

&lt;h2 id=&quot;what-the-grant-type-already-tells-you&quot;&gt;What the grant type already tells you&lt;/h2&gt;

&lt;p&gt;If access arrived as a &lt;strong&gt;canonical user ID grant in the bucket ACL&lt;/strong&gt; rather than as a bucket
policy, you can predict the shape of what will work before you try it, and it is a shape that
confuses people:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;s3 ls s3://bucket/prefix/&lt;/code&gt; fails with AccessDenied — listing is a bucket-level operation.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;s3 cp s3://bucket/prefix/object .&lt;/code&gt; succeeds — reading is an object-level operation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Which means the data is fully readable and completely unbrowsable. You cannot discover keys;
you can only fetch keys you were told about. The practical consequence is that the transfer has
to be &lt;strong&gt;manifest-driven&lt;/strong&gt;: ask the owner for the key list, or get it from the accompanying
metadata, and drive the download from that file. A recursive sync will fail at the first
listing call and the error will look like a credentials problem.&lt;/p&gt;

&lt;p&gt;This is also the reason to check the grant type early. “Can I list it?” and “can I read it?”
have different answers here, and a plan built on the assumption that listing works needs
rewriting rather than retrying.&lt;/p&gt;

&lt;h2 id=&quot;egress-is-charged-to-the-bucket-owner-by-default&quot;&gt;Egress is charged to the bucket owner by default&lt;/h2&gt;

&lt;p&gt;The default, with Requester Pays off, is that the &lt;strong&gt;bucket owner&lt;/strong&gt; pays for data transfer out.
That is the usual arrangement for a data-distribution bucket run by a repository or a
collaborating lab: they have budgeted for distribution, and they would rather not add a billing
negotiation to every data request.&lt;/p&gt;

&lt;p&gt;So for a standard download from a public-facing research bucket, with Requester Pays
established as off by the behavioural test above, the cost attribution is:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;egress: paid by the data owner&lt;/li&gt;
  &lt;li&gt;your own account: effectively nothing for the transfer itself&lt;/li&gt;
  &lt;li&gt;your real costs: the storage you land it on, and anything you then run over it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last line is the one worth putting in front of whoever asked for the data, because it is
the cost that does not go away. Egress is a one-off on someone else’s invoice; the capacity is
yours for as long as the project lasts.&lt;/p&gt;

&lt;h2 id=&quot;record-it-where-it-will-be-read-again&quot;&gt;Record it where it will be read again&lt;/h2&gt;

&lt;p&gt;A verbal “they pay for it” does not survive the project. The thing that works is a small
structured record per dataset, checked into the repository and rendered anywhere the transfer’s
status is displayed — so the cost question is answered in the same place as the progress
question and cannot drift away from it.&lt;/p&gt;

&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;dataset&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;example-cohort-r5&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;bucket&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;s3://example-distribution/prefix/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;access_model&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;canonical-user-ID bucket ACL grant&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;reading_as&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;arn:aws:iam::&amp;lt;account&amp;gt;:user/&amp;lt;downloader&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;requester_pays&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;requester_pays_method&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;behavioural: HEAD without x-amz-request-payer succeeded&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;verified_on&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2026-10-03&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;egress_paid_by&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;data owner&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;our_transfer_cost&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;our_ongoing_cost&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;destination capacity + compute&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;if_this_changes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;owner enabling Requester Pays mid-transfer returns 403 AccessDenied&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;if_this_changes&lt;/code&gt; field earns its place. If the owner enables Requester Pays while a long
transfer is running, your requests start returning 403 — they do not start silently billing
you, which is the good news. The bad news is how that 403 gets classified. A bare &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AccessDenied&lt;/code&gt;
often does not match a downloader’s credential-expiry pattern, so it gets counted as a generic
failure and retried. Visible in the failure column, yes; but it will not raise the
“re-authenticate” alert, and an operator reading a dashboard sees retries rather than a policy
change. Worth knowing which bucket your alerting puts it in.&lt;/p&gt;

&lt;h2 id=&quot;a-short-checklist-before-a-large-pull&quot;&gt;A short checklist before a large pull&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Probe Requester Pays behaviourally with one &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;head-object&lt;/code&gt; and no payer header.&lt;/li&gt;
  &lt;li&gt;Establish whether listing works; if not, obtain a manifest and drive from it.&lt;/li&gt;
  &lt;li&gt;Confirm the identity you are actually reading as — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aws sts get-caller-identity&lt;/code&gt; — and that
it is the identity the grant was issued to.&lt;/li&gt;
  &lt;li&gt;Size the destination, including the headroom for whatever the first analysis step writes.&lt;/li&gt;
  &lt;li&gt;Write down who pays, how you established it, and what a mid-transfer change would look like.&lt;/li&gt;
  &lt;li&gt;Decide the verification method now, while you can still ask the owner for checksums.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Cause&lt;/th&gt;
      &lt;th&gt;Action&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;get-bucket-request-payment&lt;/code&gt; denied&lt;/td&gt;
      &lt;td&gt;Object-level grant, no bucket-config permission&lt;/td&gt;
      &lt;td&gt;test behaviourally instead&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;s3 ls&lt;/code&gt; denied but &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;s3 cp&lt;/code&gt; works&lt;/td&gt;
      &lt;td&gt;Canonical-ID ACL grant&lt;/td&gt;
      &lt;td&gt;manifest-driven download&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;403 on every object mid-transfer&lt;/td&gt;
      &lt;td&gt;Payer requirement turned on, or grant withdrawn&lt;/td&gt;
      &lt;td&gt;add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--request-payer&lt;/code&gt;, confirm with the owner&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Transfer succeeds, surprise invoice&lt;/td&gt;
      &lt;td&gt;Requester Pays was on and the tool set the header for you&lt;/td&gt;
      &lt;td&gt;probe before, not after&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Recursive sync fails immediately&lt;/td&gt;
      &lt;td&gt;First call is a LIST&lt;/td&gt;
      &lt;td&gt;drive from a key list&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Keep the small request and its response with the transfer plan. When configuration access is restricted, that test records how the permitted download path behaved, including whether it required the payer header.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>On a caching filesystem, decide which side owns the ACL</title>
    <link href="https://www.wirewalk.com/writing/caching-filesystems-where-the-acl-is-authoritative/"/>
    <published>2026-09-29T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/caching-filesystems-where-the-acl-is-authoritative/</id>
    <summary>Set an ACL on the cache and it reverts, because the home side is authoritative and revalidation overwrites what you did. Add chmod silently destroying NFSv4 ACLs and you have permissions that appear to work and then stop.</summary>
    <content type="html">&lt;p&gt;You grant a collaborator access, verify it and find the permission has disappeared a minute later. On a caching filesystem, check which side owns the metadata before trying the change again. The cache may be restoring the authoritative permissions from home.&lt;/p&gt;

&lt;h2 id=&quot;the-cache-is-a-view-and-views-do-not-own-data&quot;&gt;The cache is a view, and views do not own data&lt;/h2&gt;

&lt;p&gt;In a caching architecture — AFM over NFS being the common one in HPC, with an enterprise NAS as
the home filesystem — the cache fileset holds a local copy of data whose authority lives
elsewhere. Reads are served locally; metadata is revalidated against home on an interval; and
when the two disagree about metadata, &lt;strong&gt;home wins&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Permissions and ACLs are metadata. So:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nfs4_setfacl &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;A::collaborator@domain:rxtncy&apos;&lt;/span&gt; /gpfs/cache/dataset/
&lt;span class=&quot;c&quot;&gt;# correct output immediately afterwards&lt;/span&gt;
nfs4_getfacl /gpfs/cache/dataset/
&lt;span class=&quot;c&quot;&gt;# ... and the grant is gone some tens of seconds later&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Nothing failed. The revalidation interval elapsed, the cache asked home what the metadata
should be, and home said something different. The grant you applied was overwritten by the
design of the system.&lt;/p&gt;

&lt;p&gt;The fix is structural, not a different command: &lt;strong&gt;apply the ACL on the home filesystem.&lt;/strong&gt; Set it
on the NAS, let it propagate into the cache, and verify on the cache side that it arrived. If
your access to the NAS is through a different team, that is the real dependency in the task, and
discovering it before you promise a timeline is the whole value of knowing this.&lt;/p&gt;

&lt;p&gt;Two things worth establishing before you start:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmlsfileset &amp;lt;fs&amp;gt; &amp;lt;fileset&amp;gt; &lt;span class=&quot;nt&quot;&gt;--afm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;# is this a cache, and what is home?&lt;/span&gt;
mmafmctl &amp;lt;fs&amp;gt; getstate                  &lt;span class=&quot;c&quot;&gt;# cache state, gateway, queue depth&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A cache in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Dirty&lt;/code&gt; state with a deep queue is still serving reads and is not an error by itself,
but it does mean local changes are pending writeback, and it is the wrong moment to be reasoning
about whose metadata is current.&lt;/p&gt;

&lt;h2 id=&quot;chmod-destroys-an-nfsv4-acl-chown-does-not&quot;&gt;chmod destroys an NFSv4 ACL; chown does not&lt;/h2&gt;

&lt;p&gt;Independent of caching, and the single most common way a working grant disappears.&lt;/p&gt;

&lt;p&gt;NFSv4 ACLs and the POSIX mode bits are two representations of overlapping state. On most
implementations, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod&lt;/code&gt; does not &lt;em&gt;merge&lt;/em&gt; with an existing ACL — it &lt;strong&gt;replaces&lt;/strong&gt; it with the
three-entry OWNER/GROUP/EVERYONE form implied by the mode. Every explicitly named user or group
is discarded, silently, with a zero exit status.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nfs4_getfacl ./data | &lt;span class=&quot;nb&quot;&gt;wc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;# 7 entries&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;750 ./data
nfs4_getfacl ./data | &lt;span class=&quot;nb&quot;&gt;wc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;# 3 entries. The grant is gone.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chown&lt;/code&gt; is safe: it changes the owner, and the ACL survives.&lt;/p&gt;

&lt;p&gt;The practical consequence is about ordering and about other people’s scripts. Set ownership
first, ACLs second, and never let a cleanup script run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod -R&lt;/code&gt; over a tree whose access
depends on ACLs. A “tighten permissions” cron job is a perfectly good way to revoke a
collaborator’s access three weeks after you granted it, and the only trace is that it used to
work.&lt;/p&gt;

&lt;p&gt;Related trap in the same family: some tooling writes &lt;strong&gt;new&lt;/strong&gt; files without the ACL even where
directories keep it. Decryption and extraction utilities are frequent offenders — the output
directory shows &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;+&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls -l&lt;/code&gt; and the files inside do not. Check files, not just directories.&lt;/p&gt;

&lt;h2 id=&quot;inheritance-is-a-property-of-the-entry-not-of-the-directory&quot;&gt;Inheritance is a property of the entry, not of the directory&lt;/h2&gt;

&lt;p&gt;A grant on a directory that does not carry inheritance flags applies to that directory and
nothing created in it afterwards. The result is access that works for existing content and
fails for everything the project produces from then on, which reads like an intermittent fault.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nfs4_setfacl &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;A:fd:collaborator@domain:rxtncy&apos;&lt;/span&gt; /path/dir
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fd&lt;/code&gt; flags — file-inherit, directory-inherit — are what make new content inherit. Add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;i&lt;/code&gt;
(inherit-only) when the entry should apply to children but not to the directory itself.&lt;/p&gt;

&lt;p&gt;Verify inheritance by &lt;strong&gt;creating something&lt;/strong&gt;, not by reading the ACL you just set:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;touch&lt;/span&gt; /path/dir/.inherit-probe &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; nfs4_getfacl /path/dir/.inherit-probe | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;collaborator
&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /path/dir/.inherit-probe
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;verify-with-a-negative-control&quot;&gt;Verify with a negative control&lt;/h2&gt;

&lt;p&gt;Reading back the ACL confirms the ACL. It does not confirm access, and it certainly does not
confirm that access is &lt;em&gt;limited&lt;/em&gt; to who you intended. Two tests, both cheap:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# positive: can the intended identity read?&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; collaborator &lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; /path/dir/file &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;grant-ok

&lt;span class=&quot;c&quot;&gt;# negative: can an unrelated identity read? It must NOT.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; someone-else &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /path/dir/file 2&amp;gt;/dev/null &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;LEAK - too permissive&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The negative control is the one people skip, and it is the one that catches the fix that worked
by making the data world-readable. On a dataset with any access conditions attached, “the
collaborator can read it” and “only the collaborator can read it” are different claims, and only
the second one is the requirement.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# nothing in the tree should be world-readable&lt;/span&gt;
find /path/dir &lt;span class=&quot;nt&quot;&gt;-perm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;r | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;a-sequence-that-works&quot;&gt;A sequence that works&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Establish whether the target is a cache, and what home is.&lt;/li&gt;
  &lt;li&gt;Apply the grant &lt;strong&gt;on the authoritative side&lt;/strong&gt;, with inheritance flags.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chown&lt;/code&gt; where needed; never &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod&lt;/code&gt; afterwards.&lt;/li&gt;
  &lt;li&gt;Wait out the revalidation interval, then read the ACL on the cache side.&lt;/li&gt;
  &lt;li&gt;Positive test as the intended identity.&lt;/li&gt;
  &lt;li&gt;Negative test as an unrelated identity, plus a world-readable sweep.&lt;/li&gt;
  &lt;li&gt;Create a file and confirm it inherited.&lt;/li&gt;
  &lt;li&gt;Write down that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod -R&lt;/code&gt; on this tree revokes access, where the next person will see it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 8 is not administrative tidiness. The failure it prevents arrives weeks later, with no
connection to anything anyone changed that day.&lt;/p&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Cause&lt;/th&gt;
      &lt;th&gt;Action&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;ACL correct, gone a minute later&lt;/td&gt;
      &lt;td&gt;Cache revalidated against authoritative home&lt;/td&gt;
      &lt;td&gt;set it on home&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Grant vanished after a tidy-up job&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod&lt;/code&gt; replaced the NFSv4 ACL&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chown&lt;/code&gt; only; audit scripts for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod -R&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Old files accessible, new ones not&lt;/td&gt;
      &lt;td&gt;Entry lacks &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fd&lt;/code&gt; inheritance flags&lt;/td&gt;
      &lt;td&gt;re-add with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fd&lt;/code&gt;, probe with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;touch&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Directories show &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;+&lt;/code&gt;, files do not&lt;/td&gt;
      &lt;td&gt;Tool wrote output without the ACL&lt;/td&gt;
      &lt;td&gt;re-apply to files; check files explicitly&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Collaborator can read, so can everyone&lt;/td&gt;
      &lt;td&gt;Fixed by loosening the mode&lt;/td&gt;
      &lt;td&gt;negative control; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find -perm -o=r&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Works on one node, not another&lt;/td&gt;
      &lt;td&gt;Different mount, or stale metadata on that client&lt;/td&gt;
      &lt;td&gt;compare &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;findmnt&lt;/code&gt;; check cache state&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Apply the permission change on the authoritative side, then verify it from the clients that need access. Include a denied-access test so restoring collaboration does not accidentally expose the dataset more widely.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Directories that use everything in them, including your backup file</title>
    <link href="https://www.wirewalk.com/writing/directories-that-execute-everything-in-them/"/>
    <published>2026-09-25T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/directories-that-execute-everything-in-them/</id>
    <summary>A whole class of Unix configuration is &quot;every file in this directory counts&quot;. Edit one in place and leave a .bak beside it, and the backup becomes live configuration — displayed to users, parsed as a job, or loaded as software.</summary>
    <content type="html">&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cp file file.bak&lt;/code&gt; before editing is such deeply ingrained practice that it does not get
thought about. It is also wrong in a specific and common situation: when the directory the file
lives in is a &lt;strong&gt;drop-in directory&lt;/strong&gt;, where the consuming program’s contract is “use every file
in here”.&lt;/p&gt;

&lt;p&gt;In that case the backup is not inert. It is a second live copy of the configuration — usually an
older one — and the program has no notion that one of these files is special.&lt;/p&gt;

&lt;h2 id=&quot;the-contract-stated-plainly&quot;&gt;The contract, stated plainly&lt;/h2&gt;

&lt;p&gt;From &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;man 8 pam_motd&lt;/code&gt;, on the directory used to assemble the login message:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The /path/dirname.d directory is scanned and each file contained inside of it is displayed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Each file.&lt;/strong&gt; No extension filter, no exclusion of anything that looks like a backup. So a
login banner edited in place, with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;userinfo.motd.bak-20261017&lt;/code&gt; left beside it, prints twice —
the current text and the superseded text, concatenated, to every user who logs in. The file you
edited is correct. The thing users see is not.&lt;/p&gt;

&lt;p&gt;The same contract, different consumer, with worse consequences: environment modules treats every
regular file under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MODULEPATH&lt;/code&gt; as a loadable module.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module avail
matlab/2025a
matlab/2025a.bak-lnhint       &amp;lt;-- loads the PRE-EDIT modulefile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That entry is offered to users by tab completion and by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module avail&lt;/code&gt;, and loading it applies
the old configuration. It is not a cosmetic blemish; it is a shadow copy of software
configuration that silently wins for anyone who selects it. Worse for debugging: a verification
script that resolves “the latest matlab” by sorting the directory listing will pick
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2025a.bak-lnhint&lt;/code&gt;, test the old file, and report that the change did not take effect — sending
you after a bug that does not exist.&lt;/p&gt;

&lt;h2 id=&quot;the-directories-this-applies-to&quot;&gt;The directories this applies to&lt;/h2&gt;

&lt;p&gt;Not exhaustive, but these cover most of it:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Directory&lt;/th&gt;
      &lt;th&gt;Consumer&lt;/th&gt;
      &lt;th&gt;What a stray file does&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/motd.d/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pam_motd&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;printed to every user at login&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/cron.d/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;cron&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;parsed and run as a job&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/sudoers.d/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;sudo&lt;/td&gt;
      &lt;td&gt;grants or denies; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;visudo -c&lt;/code&gt; ignores files with a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.&lt;/code&gt; in the name&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/profile.d/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;login shells&lt;/td&gt;
      &lt;td&gt;sourced — only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.sh&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.csh&lt;/code&gt;, so a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bak&lt;/code&gt; is inert here&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/yum.repos.d/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;dnf&lt;/td&gt;
      &lt;td&gt;an old &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.repo.bak&lt;/code&gt; is &lt;strong&gt;not&lt;/strong&gt; read (needs &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.repo&lt;/code&gt;), but &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.repo.orig&lt;/code&gt; edits are&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/systemd/system/*.d/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;systemd&lt;/td&gt;
      &lt;td&gt;only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.conf&lt;/code&gt;; other names ignored&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/ld.so.conf.d/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;ldconfig&lt;/td&gt;
      &lt;td&gt;only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.conf&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/NetworkManager/conf.d/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;NetworkManager&lt;/td&gt;
      &lt;td&gt;only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.conf&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MODULEPATH&lt;/code&gt; trees&lt;/td&gt;
      &lt;td&gt;environment modules&lt;/td&gt;
      &lt;td&gt;every regular file is a module&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/logrotate.d/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;logrotate&lt;/td&gt;
      &lt;td&gt;every file, unless &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tabooext&lt;/code&gt; excludes it&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The pattern to internalise is that the directories split into two groups: those that &lt;strong&gt;filter by
extension&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;profile.d&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.d/*.conf&lt;/code&gt; under systemd, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ld.so.conf.d&lt;/code&gt;) where a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bak&lt;/code&gt; is harmless,
and those that &lt;strong&gt;take everything&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;motd.d&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cron.d&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;logrotate.d&lt;/code&gt; modulo taboo lists,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MODULEPATH&lt;/code&gt;) where it is not. Guessing which is which is not a strategy; the manual page says,
and it is a two-minute check.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/cron.d&lt;/code&gt; deserves singling out. A superseded crontab left in place keeps running. If you
“paused” a job by commenting out its line in the current file, and a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bak-&lt;/code&gt; copy of the
uncommented version is still sitting in the directory, the job continues on schedule and the
file you are reading says it should not. That is a genuinely difficult thing to diagnose from
the current configuration, because the current configuration is correct.&lt;/p&gt;

&lt;h2 id=&quot;where-backups-should-go&quot;&gt;Where backups should go&lt;/h2&gt;

&lt;p&gt;Three options, in order of preference:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Out of the directory entirely.&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;BK&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/root/config-backups&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$BK&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; /etc/motd.d/userinfo.motd &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$BK&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/userinfo.motd.&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; +%Y%m%d-%H%M%S&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2. A hidden subdirectory, when the consumer skips dotted entries&lt;/strong&gt; — true for environment
modules, which ignores &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.&lt;/code&gt;-prefixed names. Preserve the relative path so a restore is a single
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mv&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;M&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/share/Modules/modulefiles
&lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$M&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/matlab/2025a&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$M&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.backups/matlab/2025a&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Verify the exclusion rather than trusting it. Drop a probe in and confirm it does not appear:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$M&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.backups&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;#%Module&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$M&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.backups/ZZPROBE&quot;&lt;/span&gt;
module avail &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; 2&amp;gt;&amp;amp;1 | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; ZZPROBE      &lt;span class=&quot;c&quot;&gt;# expect 0&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$M&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.backups/ZZPROBE&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. Version control, and no backup file at all.&lt;/strong&gt; The reason the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bak&lt;/code&gt; habit exists is that
there is no other way back. Where the configuration is in a repository, there is, and the
cleanest drop-in directory is one that only ever contains live files.&lt;/p&gt;

&lt;p&gt;One caveat on hidden subdirectories: put them where the &lt;strong&gt;shared&lt;/strong&gt; copy lives. If a tree is a
mount point — a network or parallel filesystem mounted at a path whose parent is local disk — a
sibling backup directory created one level up is node-local, so your backups scatter across
whichever host you happened to run the edit on. Check with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;findmnt&lt;/code&gt; before choosing the
location.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-consumers-output-not-your-file&quot;&gt;Verify the consumer’s output, not your file&lt;/h2&gt;

&lt;p&gt;The general lesson is the one that makes this class of bug expensive: every check performed on
the file was green, because the file was right. The fault was in the directory, which nothing
was looking at.&lt;/p&gt;

&lt;p&gt;So assert on what the consumer produces:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# how many files will pam_motd actually print?&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; /etc/motd.d | &lt;span class=&quot;nb&quot;&gt;wc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;                    &lt;span class=&quot;c&quot;&gt;# expect exactly 1&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# does the module system offer anything it should not?&lt;/span&gt;
module avail &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; 2&amp;gt;&amp;amp;1 | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;\.bak&apos;&lt;/span&gt;       &lt;span class=&quot;c&quot;&gt;# expect 0&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# what does cron believe it has been told to run?&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rhE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;^[^#]&apos;&lt;/span&gt; /etc/cron.d/ | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And when you are checking whether an edit took effect, be careful that the probe itself does not
select the backup. Resolving “the newest version in this directory” by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls | tail -1&lt;/code&gt; is exactly
how a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bak-&lt;/code&gt; suffix gets tested instead of the real file.&lt;/p&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Cause&lt;/th&gt;
      &lt;th&gt;Check&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Login banner shows old and new text&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bak&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/motd.d&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls -1 /etc/motd.d&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;A “paused” cron job still runs&lt;/td&gt;
      &lt;td&gt;Superseded file in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/cron.d&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -rhE &apos;^[^#]&apos; /etc/cron.d/&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module avail&lt;/code&gt; lists &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.bak*&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Backups under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MODULEPATH&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;move to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.backups/&lt;/code&gt;, verify with a probe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Edit appears to have no effect&lt;/td&gt;
      &lt;td&gt;Test resolved to the backup file&lt;/td&gt;
      &lt;td&gt;print the path the test used&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Backups present on one node only&lt;/td&gt;
      &lt;td&gt;Backup dir on a local parent of a shared mount&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;findmnt --target&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;sudo rule ignored&lt;/td&gt;
      &lt;td&gt;Filename contains a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;rename; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;visudo -c&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Keep backups outside directories whose consumers read every file. After editing, inspect the consumer’s output to confirm that only the intended configuration was loaded.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Verifying a multi-terabyte transfer: which checksum, and at what rate</title>
    <link href="https://www.wirewalk.com/writing/verifying-multi-terabyte-transfer-checksums/"/>
    <published>2026-09-22T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/verifying-multi-terabyte-transfer-checksums/</id>
    <summary>A transfer that reports success has told you about HTTP status codes, not about bytes. Verifying tens of terabytes is tractable, but only if you pick a checksum the provider will actually give you for whole objects.</summary>
    <content type="html">&lt;p&gt;For data that will feed months of analysis, matching object counts and byte sizes is not enough to check a bulk download. Those checks catch missing or truncated files, but corruption inside a large object needs a content comparison.&lt;/p&gt;

&lt;p&gt;Before starting the verification pass, find out which checksum the source supplies and what bytes it covers.&lt;/p&gt;

&lt;h2 id=&quot;the-etag-will-usually-not-help-you&quot;&gt;The ETag will usually not help you&lt;/h2&gt;

&lt;p&gt;For an object uploaded in one piece, the S3 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ETag&lt;/code&gt; is the MD5 of the content, and you can
compare it directly. For anything uploaded as a multipart — which is everything large, because
that is how large objects get uploaded — the ETag is a digest &lt;em&gt;of the part digests&lt;/em&gt;, with the
part count appended:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&quot;a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6-7210&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-7210&lt;/code&gt; is the tell: 7,210 parts. To reproduce the value you need the exact part size the
uploader used, and the part boundaries, and then you have to hash each part and hash the
concatenation of those hashes. If the uploader used a non-uniform part size, you cannot
reproduce it at all. Treat a hyphen in an ETag as “this field is not a content hash”.&lt;/p&gt;

&lt;h2 id=&quot;ask-for-a-checksum-that-covers-the-whole-object&quot;&gt;Ask for a checksum that covers the whole object&lt;/h2&gt;

&lt;p&gt;Modern S3 supports additional checksum algorithms that are stored as object metadata, and the
one that matters here is whether the stored value covers the &lt;strong&gt;whole object&lt;/strong&gt; or only parts.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws s3api head-object &lt;span class=&quot;nt&quot;&gt;--bucket&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$B&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--key&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$K&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--checksum-mode&lt;/span&gt; ENABLED &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--query&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{Algo:ChecksumType,CRC64:ChecksumCRC64NVME,SHA256:ChecksumSHA256,ETag:ETag}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;Algo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;FULL_OBJECT&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;CRC64&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;k3Nf0pQ2vLs=&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;SHA256&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;ETag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;a1b2...-7210&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChecksumType: FULL_OBJECT&lt;/code&gt; is the field to look for. With CRC64NVME it is the common case, and
it means the provider is giving you one value you can compute locally over the assembled file —
no part boundaries required. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;COMPOSITE&lt;/code&gt; means you are back in part-digest territory and the
value is not directly comparable.&lt;/p&gt;

&lt;p&gt;Two practical constraints that are easy to discover the hard way:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;A ranged GET returns no checksum.&lt;/strong&gt; If your verification reads objects in ranges, there is
nothing to compare. Hash the local file; take the stored value from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;head-object&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;The algorithm has to have been set at upload time.&lt;/strong&gt; You cannot ask a bucket to produce a
SHA256 for an object that was written without one. Check what is actually there before
designing the comparison; if the answer is “nothing but a multipart ETag”, your verification
is a size-and-count check plus a re-download of a sample, and you should say so rather than
implying a cryptographic guarantee.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;crc64nvme-locally-fast-enough-to-not-matter&quot;&gt;CRC64NVME locally, fast enough to not matter&lt;/h2&gt;

&lt;p&gt;CRC64NVME is cheap — a few GB/s per core with a table-driven implementation, and effectively
free next to the storage. Python with a compiled backend is sufficient:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;sys&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;anycrc&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Model&lt;/span&gt;            &lt;span class=&quot;c1&quot;&gt;# or any CRC-64/NVME implementation
&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;base64&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;crc&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;CRC64-NVME&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;rb&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buffering&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chunk&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;     &lt;span class=&quot;c1&quot;&gt;# 16 MiB reads suit a parallel filesystem
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;chunk&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;base64&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b64encode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;digest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_bytes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;big&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)).&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;decode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note the base64: S3 returns the checksum base64-encoded, not as hex. Comparing a hex string to
a base64 string produces a mismatch on every object, which looks like catastrophic corruption
for the ten minutes it takes to notice.&lt;/p&gt;

&lt;h2 id=&quot;the-rate-is-a-parallelism-problem-not-a-hashing-problem&quot;&gt;The rate is a parallelism problem, not a hashing problem&lt;/h2&gt;

&lt;p&gt;Hashing is not the bottleneck; reading is. On a parallel filesystem the useful shape is many
files in flight, large reads, and no single-threaded driver walking the tree.&lt;/p&gt;

&lt;p&gt;Two numbers from the same verification run, to show how badly this can be misjudged. An early
estimate taken while the job was running said &lt;strong&gt;660 MB/s, about 26 hours&lt;/strong&gt;. It was computed
from the first handful of completed objects — which were the small ones, because small files
finish first. Once the large multi-terabyte objects landed, the real aggregate for the full pass
was &lt;strong&gt;11.4 GiB/s, and it finished in 88 minutes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The estimate was not slightly off. It was wrong by a factor of 17, in the pessimistic
direction, because it extrapolated from a sample that was biased by construction. This is the
general hazard in any progress estimate over unevenly sized work: completion order is
correlated with size, so the early sample is never representative.&lt;/p&gt;

&lt;p&gt;Practical guidance for the run itself:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Drive concurrency from a file list, not a directory walk, so the work can be split and
resumed.&lt;/li&gt;
  &lt;li&gt;Pick the unit of parallelism to match the storage. Tens of concurrent readers with large
sequential reads will saturate most parallel filesystems; hundreds will produce queueing and
a worse number.&lt;/li&gt;
  &lt;li&gt;Write one result line per object — key, expected, computed, verdict — so a partial run is
still evidence and a re-run only covers what is missing.&lt;/li&gt;
  &lt;li&gt;Report &lt;strong&gt;bytes&lt;/strong&gt; verified, not objects. One object in a thousand can be most of the data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;where-the-job-should-run-and-as-whom&quot;&gt;Where the job should run, and as whom&lt;/h2&gt;

&lt;p&gt;This is the part people reorganise twice. If the destination directory is owned by another user
and mode &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0700&lt;/code&gt;, the verification cannot run as a normal user through the scheduler, because the
scheduler runs jobs as the submitting user. Options, in order of preference:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Have the data owner run it, which is correct and often not practical on their timetable.&lt;/li&gt;
  &lt;li&gt;Run it as root on a node that has the filesystem mounted and the fast path to it.&lt;/li&gt;
  &lt;li&gt;Grant the verifying identity read access via an ACL — which is fine, but be aware that on
many filesystems a later &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod&lt;/code&gt; on those paths will destroy the ACL while &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chown&lt;/code&gt; leaves it
intact.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Option 2 is usually what happens. It is worth writing down which node, and why: the node that
has both the filesystem and the high-bandwidth route is frequently not the node people log in
to, and discovering that mid-run costs a restart.&lt;/p&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Cause&lt;/th&gt;
      &lt;th&gt;Resolution&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Every object mismatches&lt;/td&gt;
      &lt;td&gt;Comparing hex against base64&lt;/td&gt;
      &lt;td&gt;encode locally the way the API returns it&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ETag will not reproduce&lt;/td&gt;
      &lt;td&gt;Multipart digest-of-digests&lt;/td&gt;
      &lt;td&gt;use a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FULL_OBJECT&lt;/code&gt; checksum, or do not claim content verification&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;No checksum in the response&lt;/td&gt;
      &lt;td&gt;Ranged GET, or none stored at upload&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;head-object&lt;/code&gt; for the stored value; check it exists first&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Throughput an order of magnitude below the filesystem&lt;/td&gt;
      &lt;td&gt;Serial reads, or one reader per small file&lt;/td&gt;
      &lt;td&gt;parallel readers, 8–16 MiB reads, list-driven&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ETA wildly pessimistic early&lt;/td&gt;
      &lt;td&gt;Small objects complete first&lt;/td&gt;
      &lt;td&gt;weight progress by bytes, not object count&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Verification cannot read the data&lt;/td&gt;
      &lt;td&gt;Destination is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0700&lt;/code&gt; and owned elsewhere&lt;/td&gt;
      &lt;td&gt;run as owner or root; mind ACL-destroying &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Report which comparison was performed. If the source provides an independent checksum, name the algorithm and coverage. If it does not, say that sizes and counts match, and document any sample re-downloads without presenting them as full content verification.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>GPU utilization is not utilization: reading MFU without fooling yourself</title>
    <link href="https://www.wirewalk.com/writing/reading-gpu-utilization-mfu-honestly/"/>
    <published>2026-09-18T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/reading-gpu-utilization-mfu-honestly/</id>
    <summary>nvidia-smi reporting 100% means a kernel was resident, not that the tensor cores did useful work. Model FLOPs utilization is the honest number, and a mid-thirties result on a real training run is normal rather than alarming.</summary>
    <content type="html">&lt;p&gt;Before approving more GPUs for a job reporting 100% utilization, ask what that field measures. It tells you that kernels were active during the sample; it does not tell you how much useful model work the hardware completed.&lt;/p&gt;

&lt;h2 id=&quot;what-nvidia-smis-utilization-field-measures&quot;&gt;What nvidia-smi’s utilization field measures&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;utilization.gpu&lt;/code&gt; is the percentage of the sampling interval during which &lt;strong&gt;at least one kernel
was executing&lt;/strong&gt;. One kernel. It says nothing about how many SMs that kernel occupied, whether
the tensor cores were used, or whether the kernel spent its time waiting on memory.&lt;/p&gt;

&lt;p&gt;A single-threaded kernel that reads one float per clock will report 100% utilization while
delivering a rounding error of the device’s capability.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvidia-smi &lt;span class=&quot;nt&quot;&gt;--query-gpu&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;utilization.gpu,utilization.memory,power.draw,clocks.sm &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
           &lt;span class=&quot;nt&quot;&gt;--format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;csv &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; 5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two cross-checks available right there, and both are more informative than the utilization
field:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Power draw.&lt;/strong&gt; A device doing dense tensor work sits near its board limit. A device reporting
100% utilization at a third of its power limit is not doing dense arithmetic. This is the
single fastest sanity check available.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;SM clocks.&lt;/strong&gt; Sustained work at well below the boost clock suggests thermal or power
capping, which is a facilities answer rather than a code answer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For anything beyond a spot check, use DCGM, which exposes occupancy and pipe activity rather
than a boolean “busy”:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dcgmi dmon &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; 1002,1003,1004,1005,1009,1010 &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; 10
&lt;span class=&quot;c&quot;&gt;#        gr_engine_active, sm_active, sm_occupancy, tensor_active, ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DCGM_FI_PROF_PIPE_TENSOR_ACTIVE&lt;/code&gt; is the one that answers the real question for training work:
what fraction of the time were the tensor cores issuing. It is routinely in the teens or
twenties on jobs whose &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-smi&lt;/code&gt; utilization reads 100%.&lt;/p&gt;

&lt;h2 id=&quot;model-flops-utilization&quot;&gt;Model FLOPs utilization&lt;/h2&gt;

&lt;p&gt;The honest metric for training is MFU: the arithmetic the model definition requires, divided by
what the hardware could theoretically deliver in the same wall-clock time.&lt;/p&gt;

&lt;p&gt;For a dense transformer, forward and backward together, the standard approximation is&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FLOPs per token ≈ 6 × N          (N = non-embedding parameter count)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;with an attention term that matters at long context:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FLOPs per token ≈ 6N + 12 × L × H × S
    L = layers, H = hidden size, S = sequence length
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;achieved  = tokens_per_second × FLOPs_per_token
MFU       = achieved / device_peak_dense_FLOPS / num_devices
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The denominator has to be the &lt;strong&gt;dense, non-sparse&lt;/strong&gt; figure for the dtype actually used. Vendor
headline numbers are frequently the sparsity-enabled value, which doubles it, and quoting MFU
against that halves your result for no reason. If you use bf16 tensor cores, use the bf16 dense
number.&lt;/p&gt;

&lt;p&gt;A worked example, with figures that are illustrative rather than a product claim: a single
modern data-centre GPU running a parameter-efficient fine-tune delivering roughly &lt;strong&gt;350 TFLOPS
of useful model arithmetic against a dense bf16 peak near 990 TFLOPS&lt;/strong&gt; lands at about &lt;strong&gt;35%
MFU&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That is not a problem to be fixed. For LLM training, well-tuned jobs commonly sit in the 35–50%
band; large, heavily engineered pretraining runs reach higher. A job at 35% MFU and 100%
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-smi&lt;/code&gt; utilization is behaving normally. A job at 4% MFU and 100% utilization has a real
problem, and the utilization field cannot distinguish them — which is the entire argument for
computing MFU.&lt;/p&gt;

&lt;h2 id=&quot;what-low-mfu-actually-points-to&quot;&gt;What low MFU actually points to&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Observation&lt;/th&gt;
      &lt;th&gt;Bottleneck&lt;/th&gt;
      &lt;th&gt;Direction&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;MFU low, power draw low, tensor_active low&lt;/td&gt;
      &lt;td&gt;Memory-bound or launch-bound&lt;/td&gt;
      &lt;td&gt;fuse kernels, raise batch, check dtype&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MFU low, power high&lt;/td&gt;
      &lt;td&gt;Doing arithmetic that is not model FLOPs&lt;/td&gt;
      &lt;td&gt;recompute/checkpointing overhead, padding waste&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Throughput scales poorly past one node&lt;/td&gt;
      &lt;td&gt;Collective bandwidth or topology&lt;/td&gt;
      &lt;td&gt;measure allreduce separately&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Large variance between steps&lt;/td&gt;
      &lt;td&gt;Data loading, or a straggler rank&lt;/td&gt;
      &lt;td&gt;time the loader; check per-rank step times&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Good single-GPU MFU, poor multi-GPU&lt;/td&gt;
      &lt;td&gt;Communication not overlapped&lt;/td&gt;
      &lt;td&gt;overlap, gradient bucketing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MFU drops as context grows&lt;/td&gt;
      &lt;td&gt;Attention term now dominant&lt;/td&gt;
      &lt;td&gt;expected; use the full formula&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Padding deserves a line of its own because it is invisible in every utilization metric. If
sequences are padded to a fixed length and the real distribution is much shorter, a large share
of the arithmetic is performed on padding. The GPU is genuinely busy, the tensor cores are
genuinely active, and a meaningful fraction of the work is on tokens that do not exist. Sequence
packing or length bucketing recovers it, and the before/after shows up in tokens per second
while &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-smi&lt;/code&gt; does not move at all.&lt;/p&gt;

&lt;h2 id=&quot;measure-the-collective-separately-before-blaming-the-model&quot;&gt;Measure the collective separately before blaming the model&lt;/h2&gt;

&lt;p&gt;When scaling stops, the question is whether the fabric or the code is at fault, and that is
answerable directly:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# bus bandwidth across the devices you will actually train on&lt;/span&gt;
./build/all_reduce_perf &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; 8 &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; 8G &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &amp;lt;gpus&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Read the &lt;strong&gt;busbw&lt;/strong&gt; column, not algbw, and compare against the link capability for the path those
devices take. If the collective achieves close to the fabric’s capability and your training step
does not improve when you overlap communication, the bottleneck is compute. If the collective is
far below, fix that first — no amount of model-side tuning compensates for a collective running
over the wrong transport.&lt;/p&gt;

&lt;p&gt;Two specifics worth checking in that order: that the job is using RDMA and has not fallen back
to TCP, and that multi-rail devices are actually both in use rather than one adapter carrying
everything.&lt;/p&gt;

&lt;h2 id=&quot;out-of-memory-is-usually-not-the-model&quot;&gt;Out-of-memory is usually not the model&lt;/h2&gt;

&lt;p&gt;A 49-billion-parameter fine-tune that OOMs on hardware that should hold it is normally an
accounting problem rather than a capacity one. The usual contributors, in the order they are
worth checking:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Optimizer state in fp32 at 8 bytes per parameter, which dwarfs the weights.&lt;/li&gt;
  &lt;li&gt;Activation memory, which scales with batch × sequence and is often the actual consumer.&lt;/li&gt;
  &lt;li&gt;Sharding configured for parameters but not optimizer state or gradients.&lt;/li&gt;
  &lt;li&gt;A tokenizer or dataloader pinning host memory that then cannot be used for staging.&lt;/li&gt;
  &lt;li&gt;Fragmentation from varying sequence lengths, which looks like a smaller device than you have.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before changing the model, print the allocator’s own summary. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;torch.cuda.memory_summary()&lt;/code&gt;
attributes memory to categories, and the category that is unexpectedly large is the answer.&lt;/p&gt;

&lt;h2 id=&quot;reporting-a-gpu-result-so-it-can-be-checked&quot;&gt;Reporting a GPU result so it can be checked&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;State tokens per second &lt;strong&gt;and&lt;/strong&gt; the MFU, with the peak figure and dtype you divided by.&lt;/li&gt;
  &lt;li&gt;State whether the peak used was dense or sparsity-enabled.&lt;/li&gt;
  &lt;li&gt;State sequence length and whether sequences were packed or padded.&lt;/li&gt;
  &lt;li&gt;State device count and whether the number is per device or aggregate.&lt;/li&gt;
  &lt;li&gt;Give the window. A step-time average over ten steps after warmup is a different number from
one taken across the first ten.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A result reported this way can be reproduced and argued with. “100% GPU utilization” cannot be,
and it is the number most often used to justify buying more hardware.&lt;/p&gt;

&lt;p&gt;For capacity planning, use useful throughput and MFU alongside utilization, with the model, precision and measurement window recorded. That provides a basis for deciding whether another GPU would help.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Why du and df disagree about a compressed filesystem</title>
    <link href="https://www.wirewalk.com/writing/measuring-compression-parallel-filesystem/"/>
    <published>2026-09-15T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/measuring-compression-parallel-filesystem/</id>
    <summary>du reports a file&apos;s apparent size, so on a transparently compressed filesystem it measures the data you wrote, not the space you occupy. Getting the real ratio means asking the allocator, and asking it about the right set of files.</summary>
    <content type="html">&lt;p&gt;After a compression policy finishes, the next question is how much storage it saved. A familiar directory-size command can give a plausible answer while looking at the wrong accounting layer. Compare logical data with the allocation reported by the filesystem.&lt;/p&gt;

&lt;h2 id=&quot;du-measures-the-wrong-thing-by-design&quot;&gt;du measures the wrong thing, by design&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;du&lt;/code&gt; without arguments reports blocks the file claims to occupy, derived from the file’s
apparent size. That is a property of the inode, not of the storage. On a filesystem where
compression happens below the file abstraction, the apparent size does not change when the
data is compressed: the file is still logically the same number of bytes, and a read still
returns them all.&lt;/p&gt;

&lt;p&gt;So &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;du -sh&lt;/code&gt; on a compressed directory returns roughly what it returned before compression ran.
Not exactly — metadata and sparse regions move it a little — which is worse than returning an
obviously identical number, because a small difference reads as a small compression ratio
rather than as a measurement that is not looking at the right layer.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;du --apparent-size&lt;/code&gt; is explicit about measuring the logical size. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;du&lt;/code&gt; without it is
&lt;em&gt;implicitly&lt;/em&gt; measuring something close to it on this class of filesystem. Neither tells you
about allocation.&lt;/p&gt;

&lt;h2 id=&quot;ask-the-component-that-allocates-blocks&quot;&gt;Ask the component that allocates blocks&lt;/h2&gt;

&lt;p&gt;The number you want is allocated blocks versus logical bytes, and only the filesystem’s own
accounting knows both. On GPFS, quota reporting is the cheapest source, because it is
maintained continuously rather than computed by walking the tree:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmrepquota &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--block-size&lt;/span&gt; 1K gpfs0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The block column is allocation. Compare it against the logical total for the same fileset to
get a ratio. For per-file detail:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmlsattr &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt; /path/to/file          &lt;span class=&quot;c&quot;&gt;# shows whether the file is compressed, and the algorithm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For a whole tree, a policy scan reports both numbers per file, which is the authoritative
version and the expensive one:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;RULE &apos;sizes&apos; LIST &apos;sizes&apos; SHOW(varchar(FILE_SIZE) || &apos; &apos; || varchar(KB_ALLOCATED))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmapplypolicy /gpfs/gpfs0/dataset &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; sizes.pol &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt; defer &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /gpfs/gpfs0/tmp/out &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt; 1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; /gpfs/gpfs0/tmp/shared
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two operational notes on that command, both of which cost time if you meet them cold. The
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-g&lt;/code&gt; directory must be on &lt;strong&gt;shared&lt;/strong&gt; storage that every participating node can write to, or
the run fails in a way that reads like a permissions problem on the data. And
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmapplypolicy&lt;/code&gt; can exit zero having done nothing useful, so check the record count in the
output file rather than the exit status.&lt;/p&gt;

&lt;p&gt;The LIST output format is worth reading once before parsing it. Each line is&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;inode&amp;gt; &amp;lt;gen&amp;gt; &amp;lt;snapid&amp;gt;  &amp;lt;FILE_SIZE&amp;gt; &amp;lt;KB_ALLOCATED&amp;gt; -- &amp;lt;path&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;with a &lt;strong&gt;single&lt;/strong&gt; ` – ` separating the fixed fields from the path. Parsers written on the
assumption of two separators aggregate nothing at all, from a scan that read every file
correctly — and they do it silently, producing a tidy zero.&lt;/p&gt;

&lt;h2 id=&quot;the-scoping-error-that-inflates-the-ratio&quot;&gt;The scoping error that inflates the ratio&lt;/h2&gt;

&lt;p&gt;Here is the mistake that produced a ratio nearly 60% too good in a real measurement, and it has
nothing to do with compression.&lt;/p&gt;

&lt;p&gt;If you are comparing a source dataset against a compressed copy — a replica, a backup target, a
migrated tree — the logical total must be computed over &lt;strong&gt;exactly the files that exist on the
target&lt;/strong&gt;. It is very easy to sum the logical size of everything the policy was supposed to
cover, divide by the allocation actually present, and report the result as a compression ratio.
What you have actually measured is compression &lt;em&gt;plus&lt;/em&gt; every file that has not been copied yet.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# the set actually present on the target, not the set we intended to send&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;present&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;ssh target &lt;span class=&quot;s2&quot;&gt;&quot;find /backup/dataset -mindepth 1 -maxdepth 1 -printf &apos;%f&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;logical&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; fs&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  if &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-qx&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$fs&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$present&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;logical&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt; logical &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;SRC_KB&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$fs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;))&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;else
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pending&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt; pending &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;))&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;# count it, do not let it into the ratio&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;fi
done&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$covered&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Reporting “ratio 1.26x, 7 filesets pending seed” is useful. Reporting “ratio 1.93x” because
seven filesets had not arrived yet is the kind of number that ends up in a capacity plan.&lt;/p&gt;

&lt;p&gt;The cross-check costs nothing: take one fileset, get its ratio from quota accounting alone, and
see whether it agrees with the aggregate. If the aggregate is much better than every individual
member, the aggregate is wrong.&lt;/p&gt;

&lt;h2 id=&quot;what-ratio-to-expect-and-why-the-average-is-not-useful&quot;&gt;What ratio to expect, and why the average is not useful&lt;/h2&gt;

&lt;p&gt;Compression ratio is a property of the data, not of the filesystem, so a single site-wide number
mostly tells you what kind of data you have:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Already-compressed formats — most genomics alignment and variant formats, JPEG, MP4, anything
gzipped — give you essentially nothing. A ratio of 1.0x here is correct behaviour, not a
misconfiguration, and burning CPU to re-compress them is a loss.&lt;/li&gt;
  &lt;li&gt;Text, logs, uncompressed tabular data, sparse scientific arrays — this is where lz4-class
algorithms earn their keep.&lt;/li&gt;
  &lt;li&gt;Many small files are dominated by metadata and block rounding, where the ratio can be worse
than 1.0 once you account for the inode and the minimum allocation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Which means the honest reporting unit is per-dataset, not per-filesystem. A single aggregate
ratio over a mixed estate is an average of things with different causes.&lt;/p&gt;

&lt;h2 id=&quot;capacity-planning-on-a-ratio-you-cannot-control&quot;&gt;Capacity planning on a ratio you cannot control&lt;/h2&gt;

&lt;p&gt;The planning trap: compression ratio is an &lt;strong&gt;observed&lt;/strong&gt; property of today’s data, and the
headroom it creates is spent by tomorrow’s data, which may compress differently. A dataset that
is 1.3x today because it is mostly text can drift to 1.0x as it fills with compressed archives,
and the filesystem fills faster than the plan said while nothing has gone wrong.&lt;/p&gt;

&lt;p&gt;Three habits that make this survivable:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Report &lt;strong&gt;both&lt;/strong&gt; logical and allocated in the dashboard, never the ratio alone. The ratio hides
a growing denominator.&lt;/li&gt;
  &lt;li&gt;Track free space against allocation. That is the number that causes an outage.&lt;/li&gt;
  &lt;li&gt;Keep an explicit list of datasets excluded from compression by design, so that “not
compressed” is visibly a decision rather than an oversight. On the panel that shows
unprotected or uncompressed data, an item that is there on purpose and unlabelled will make
the whole panel get ignored.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Cause&lt;/th&gt;
      &lt;th&gt;What to use instead&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Ratio reads ~1.0x after a successful policy run&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;du&lt;/code&gt; reporting apparent size&lt;/td&gt;
      &lt;td&gt;quota accounting, or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;KB_ALLOCATED&lt;/code&gt; from a scan&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Ratio far better than any single dataset&lt;/td&gt;
      &lt;td&gt;Logical total includes files not present on target&lt;/td&gt;
      &lt;td&gt;restrict the numerator to files that exist there&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Scan “succeeded” but aggregated nothing&lt;/td&gt;
      &lt;td&gt;LIST line has one ` – `, parser expected two&lt;/td&gt;
      &lt;td&gt;print one raw line and read it&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Policy run exits 0, no output&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-g&lt;/code&gt; not on shared storage, or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-L&lt;/code&gt; too low&lt;/td&gt;
      &lt;td&gt;check record count, not exit status&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Space shrinks less than the ratio predicts&lt;/td&gt;
      &lt;td&gt;Data was already compressed&lt;/td&gt;
      &lt;td&gt;measure per dataset, not per filesystem&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Use the filesystem’s allocation accounting for capacity planning, with logical size shown alongside it. Keep the dataset scope the same on both sides of the ratio.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>One bad line discards the whole file: the Prometheus textfile collector</title>
    <link href="https://www.wirewalk.com/writing/prometheus-textfile-collector-silent-rejection/"/>
    <published>2026-09-10T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/prometheus-textfile-collector-silent-rejection/</id>
    <summary>The textfile collector parses a metrics file as a single unit. One misplaced TYPE declaration and node_exporter drops every series in the file, while the script that wrote it exits zero and reports success.</summary>
    <content type="html">&lt;p&gt;The textfile collector is the usual way to get custom metrics into Prometheus from a machine
that has no business running an HTTP service. A cron job writes
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var/lib/node_exporter/textfile_collector/thing.prom&lt;/code&gt;, node_exporter reads it on each scrape,
and the series appear alongside everything else.&lt;/p&gt;

&lt;p&gt;The failure mode worth knowing about in advance: &lt;strong&gt;the file is parsed as a unit.&lt;/strong&gt; If any line
in it is malformed, node_exporter does not skip that line. It rejects the entire file. Four
hundred perfectly good series disappear because the four hundred and first was wrong, and the
script that produced the file exits zero, because writing a file that will later be rejected
is not an error.&lt;/p&gt;

&lt;p&gt;Dashboards go blank. Nothing alerts, because the alert was defined on a series that no longer
exists, and an expression over no data is not a breach — it is nothing at all.&lt;/p&gt;

&lt;h2 id=&quot;the-rule-that-is-easiest-to-break&quot;&gt;The rule that is easiest to break&lt;/h2&gt;

&lt;p&gt;Within one file, a metric’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;# HELP&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;# TYPE&lt;/code&gt; lines must appear &lt;strong&gt;before&lt;/strong&gt; the first sample
of that metric, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;# TYPE&lt;/code&gt; may appear only once per metric name. That sounds obvious until a
script grows by accretion: a new section is appended at the bottom, it declares a type for a
metric whose samples were already written higher up, and the file is now invalid.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# HELP repl_bytes Replicated bytes
# TYPE repl_bytes gauge
repl_bytes{fileset=&quot;a&quot;} 12
repl_bytes{fileset=&quot;b&quot;} 48
# TYPE repl_bytes gauge          &amp;lt;-- second declaration, file rejected
repl_bytes{fileset=&quot;c&quot;} 7
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The other common form is a declaration that arrives after samples because two functions each
emit “their own” block and the order they are called in changed.&lt;/p&gt;

&lt;h2 id=&quot;how-to-tell&quot;&gt;How to tell&lt;/h2&gt;

&lt;p&gt;node_exporter exposes its own verdict. Scrape it:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; localhost:9100/metrics | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;node_textfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;node_textfile_scrape_error 1
node_textfile_mtime_seconds{file=&quot;repl.prom&quot;} 1.7613e+09
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node_textfile_scrape_error 1&lt;/code&gt; means at least one file in the directory failed to parse. It
does not say which, and it does not say why — but it is the difference between “the metric is
missing” and “the metric is being refused”, and those have completely different fixes.&lt;/p&gt;

&lt;p&gt;Two things follow from this that are worth building in:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Alert on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node_textfile_scrape_error &amp;gt; 0&lt;/code&gt;.&lt;/strong&gt; It is one rule, it covers every custom metric
on every host, and it is the only signal that distinguishes a rejected file from a metric
nobody is writing.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Alert on staleness via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node_textfile_mtime_seconds&lt;/code&gt;.&lt;/strong&gt; A file that stopped being updated
parses perfectly and serves the same value forever. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;time() - node_textfile_mtime_seconds &amp;gt;
900&lt;/code&gt; catches the writer dying, which the parse-error metric never will.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The exporter’s log gives the line number, if you can get at it:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;journalctl &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; node_exporter &lt;span class=&quot;nt&quot;&gt;--since&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1h&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; textfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;validate-before-you-publish-not-after&quot;&gt;Validate before you publish, not after&lt;/h2&gt;

&lt;p&gt;The useful discipline is that the collector script should refuse to install a file it has not
checked. Write to a temporary file, validate, then move into place — the move is atomic, so a
scrape can never catch a half-written file.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;TMP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mktemp&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;trap&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;rm -f &quot;$TMP&quot;&apos;&lt;/span&gt; EXIT
generate_metrics &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$TMP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

validate&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;
    /^#[[:space:]]*(HELP|TYPE)[[:space:]]/ {
        kind=$2; name=$3
        if (kind==&quot;TYPE&quot;) {
            if (name in typed)   { printf &quot;line %d: duplicate TYPE for %s\n&quot;, NR, name; bad++ }
            if (name in sampled) { printf &quot;line %d: TYPE after samples for %s\n&quot;, NR, name; bad++ }
            typed[name]=1
        }
        next
    }
    /^[[:space:]]*#/ { next }
    /^[[:space:]]*$/ { next }
    {
        # metric_name{labels} value  [timestamp]
        name=$1; sub(/[{ ].*$/, &quot;&quot;, name)
        if (NF &amp;lt; 2)                   { printf &quot;line %d: no value\n&quot;, NR; bad++ }
        else if ($NF !~ /^[+-]?([0-9.]+([eE][+-]?[0-9]+)?|NaN|[+-]?Inf)$/) {
            printf &quot;line %d: value not a float: %s\n&quot;, NR, $NF; bad++ }
        sampled[name]=1
    }
    END { exit (bad&amp;gt;0) }&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;validate &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$TMP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$TMP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; /var/lib/node_exporter/textfile_collector/repl.prom
    &lt;span class=&quot;nb&quot;&gt;trap&lt;/span&gt; - EXIT
&lt;span class=&quot;k&quot;&gt;else
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;refusing to install malformed metrics file&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&amp;amp;2
    &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The part that matters more than the awk is the &lt;strong&gt;negative control&lt;/strong&gt;. A validator that has never
rejected anything is indistinguishable from a validator that cannot reject anything. Feed it a
file you know is bad and confirm it says so:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;x 1\n# TYPE x gauge\n&apos;&lt;/span&gt; | validate /dev/stdin &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;BUG: accepted a bad file&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If that line prints &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BUG&lt;/code&gt;, the check you were relying on was decorative.&lt;/p&gt;

&lt;h2 id=&quot;three-more-traps-in-the-same-area&quot;&gt;Three more traps in the same area&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Label churn creates series, it does not update them.&lt;/strong&gt; A label whose value is a path, a job
ID or a timestamp produces a new time series per value. The file stays small and valid while
the TSDB’s cardinality climbs. Labels are for dimensions you will group by, not for data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Writing to the directory from more than one script.&lt;/strong&gt; Two writers, one filename, and you get
interleaved content that validates about half the time. One file per writer, named after the
writer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A counter that resets because the script restarts.&lt;/strong&gt; If you compute a counter from state that
is lost on reboot, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rate()&lt;/code&gt; sees a reset and reports a spike or a gap. Either keep the state
durable, or publish it as a gauge and be honest that it is one.&lt;/p&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Likely cause&lt;/th&gt;
      &lt;th&gt;Command&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;All series from one file gone, others fine&lt;/td&gt;
      &lt;td&gt;Malformed line, whole file rejected&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl -s localhost:9100/metrics \| grep node_textfile_scrape_error&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Series present but frozen&lt;/td&gt;
      &lt;td&gt;Writer died; file still parses&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node_textfile_mtime_seconds&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Series missing, no parse error&lt;/td&gt;
      &lt;td&gt;Writer never ran, or wrong directory&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls -la&lt;/code&gt; the collector dir; check the cron line&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Metric appears then vanishes per scrape&lt;/td&gt;
      &lt;td&gt;Two writers, same filename&lt;/td&gt;
      &lt;td&gt;one file per writer&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Query works in Grafana, alert never fires&lt;/td&gt;
      &lt;td&gt;Expression over absent data is not a breach&lt;/td&gt;
      &lt;td&gt;alert on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;absent()&lt;/code&gt; as well&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Check node_exporter’s scrape-error metric after publishing a file, and confirm the expected series appear. The writer can exit successfully even when the collector rejects everything it wrote.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>An MPI troubleshooting playbook: symptom to cause</title>
    <link href="https://www.wirewalk.com/writing/mpi-troubleshooting-playbook/"/>
    <published>2026-09-09T10:00:00-04:00</published>
    <updated>2026-09-09T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/mpi-troubleshooting-playbook/</id>
    <summary>Hangs, stragglers, silent TCP fallback, launcher failures and results that change between runs. Each has a small set of causes and a command that distinguishes them, and most of the time lost is spent on the wrong layer.</summary>
    <content type="html">&lt;p&gt;Use this playbook when an MPI job is already failing and you need a check that distinguishes the likely causes. The earlier articles develop the testing order; the index below starts from the symptom.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Save the node list, environment and module versions with every run.&lt;/strong&gt; A failure that follows one node or one library combination is much easier to recognize when that information is available.&lt;/p&gt;

&lt;h2 id=&quot;the-index&quot;&gt;The index&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Most likely causes&lt;/th&gt;
      &lt;th&gt;First command&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Hangs at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MPI_Init&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;PMIx mismatch, launcher, hostfile&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mpirun --mca plm_base_verbose 10&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Hangs at first collective&lt;/td&gt;
      &lt;td&gt;QP setup, memlock, one unreachable node&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun -N all bash -c &apos;ulimit -l&apos;&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Runs, but ~10x slow&lt;/td&gt;
      &lt;td&gt;Silent TCP fallback&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_TLS=rc_x,sm,self&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Fails only above N ranks&lt;/td&gt;
      &lt;td&gt;RC queue-pair exhaustion, registration memory&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_TLS=dc_x,sm,self&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;One rank always late&lt;/td&gt;
      &lt;td&gt;Degraded link, throttled node, stray daemon&lt;/td&gt;
      &lt;td&gt;Pairwize &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; sweep&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Timings vary run to run&lt;/td&gt;
      &lt;td&gt;Allocation varies, shared ISLs, jitter&lt;/td&gt;
      &lt;td&gt;Record and compare node lists&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Bandwidth exactly half&lt;/td&gt;
      &lt;td&gt;Width negotiation, PCIe width, single rail&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lspci -vv&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Retry exceeded&lt;/code&gt; errors&lt;/td&gt;
      &lt;td&gt;Fabric drops, RoCE PFC/ECN, dead peer&lt;/td&gt;
      &lt;td&gt;Port counters, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ethtool -S&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Worse after a maintenance window&lt;/td&gt;
      &lt;td&gt;Firmware skew, routing engine fell back&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibv_devinfo&lt;/code&gt; fleet-wide, SM log&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Everything below expands one row.&lt;/p&gt;

&lt;h2 id=&quot;hangs-at-startup&quot;&gt;Hangs at startup&lt;/h2&gt;

&lt;p&gt;A job that never reaches the application is a launcher problem, not a fabric
problem, and the fabric tooling will waste your time here.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;--mca&lt;/span&gt; plm_base_verbose 10 &lt;span class=&quot;nt&quot;&gt;--mca&lt;/span&gt; rmaps_base_verbose 5 &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 4 &lt;span class=&quot;nb&quot;&gt;hostname&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That prints the launch sequence as it happens, and the point at which it stops is
the diagnosis. Common stopping points:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cannot reach a node.&lt;/strong&gt; The launcher uses SSH or the scheduler’s own launch
mechanism. If it is SSH, key-based access between compute nodes must work
non-interactively, and on a cluster with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pam_slurm_adopt&lt;/code&gt; it must work &lt;em&gt;from
within an allocation&lt;/em&gt;, which is not the same test as from the login node.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PMIx version mismatch.&lt;/strong&gt; This is the common one on schedulers, and it produces
either a hang or an error naming PMIX. Slurm and Open MPI are each built against
a PMIx, and if the two disagree, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun&lt;/code&gt;-launched MPI jobs fail while
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mpirun&lt;/code&gt;-launched ones work, or vice versa. Establish what each side has:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;srun &lt;span class=&quot;nt&quot;&gt;--mpi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;list
ompi_info | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-iE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;pmix|prrte&apos;&lt;/span&gt;
pmix_info &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then be explicit rather than relying on the default:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;srun &lt;span class=&quot;nt&quot;&gt;--mpi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;pmix &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 4 ./a.out
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun --mpi=list&lt;/code&gt; does not offer a PMIx entry, Slurm was not built with PMIx
support and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mpirun&lt;/code&gt; under an allocation is your path.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“There are not enough slots available in the system.”&lt;/strong&gt; The hostfile or the
scheduler allocation says fewer slots than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-np&lt;/code&gt; asked for. Under a scheduler,
this usually means &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mpirun&lt;/code&gt; did not pick up the allocation. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--oversubscribe&lt;/code&gt;
silences it and does not fix it; check &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$SLURM_JOB_NODELIST&lt;/code&gt; and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$SLURM_NTASKS&lt;/code&gt; instead.&lt;/p&gt;

&lt;h2 id=&quot;hangs-at-the-first-collective&quot;&gt;Hangs at the first collective&lt;/h2&gt;

&lt;p&gt;Startup succeeded, ranks exist, and the job stops the first time they all have to
talk. This is connection establishment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Locked memory limit.&lt;/strong&gt; RDMA needs pinned pages. If the limit is not unlimited
inside the job, registration fails. The limit that matters is the one inside the
launched process, which is not necessarily the one in
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/security/limits.conf&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;srun &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; 8 &lt;span class=&quot;nt&quot;&gt;--ntasks-per-node&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 bash &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;echo $(hostname) $(ulimit -l)&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Anything other than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unlimited&lt;/code&gt; on any node is the answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A node that is up but has no working adapter.&lt;/strong&gt; The job launches everywhere and
then waits for the one rank that cannot connect. Check the whole allocation
rather than a sample:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;srun &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SLURM_NNODES&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--ntasks-per-node&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 bash &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&apos;echo &quot;$(hostname) $(ibstat mlx5_0 1 | awk &quot;/State:/{print \$2}&quot; | head -1)&quot;&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Firewall on the fabric interface.&lt;/strong&gt; Rare on InfiniBand, common on RoCE, where
the traffic is UDP and a host firewall will happily block port 4791.&lt;/p&gt;

&lt;p&gt;To see where it is stuck rather than guessing, attach to a hung rank:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pstack &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;pgrep &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; a.out&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;          &lt;span class=&quot;c&quot;&gt;# or: gdb -p &amp;lt;pid&amp;gt; -batch -ex bt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A stack sitting in a UCX progress or connection-establishment function is a
transport problem. A stack in application code is not.&lt;/p&gt;

&lt;h2 id=&quot;silent-fall-back-to-tcp&quot;&gt;Silent fall back to TCP&lt;/h2&gt;

&lt;p&gt;The most expensive quiet failure in MPI, because nothing is broken. The job
completes, the numbers are bad, and the conclusion recorded is that the
application does not scale.&lt;/p&gt;

&lt;p&gt;The signature is quantitative: bandwidth roughly an order of magnitude below the
link rate and small-message latency roughly an order of magnitude above what the
fabric should give. If a two-node &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; on a 200 Gb/s fabric reports a couple
of gigabytes per second, stop tuning and check the transport.&lt;/p&gt;

&lt;p&gt;The conclusive test removes the fallback:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_TLS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;rc_x,sm,self &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_NET_DEVICES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mlx5_0:1 ./osu_bw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;No TCP transport is listed. If the job runs, RDMA was working and the problem is
elsewhere. If it fails to establish connections, TCP was carrying the traffic.&lt;/p&gt;

&lt;p&gt;Corroborate by watching the device counters move — or not — during a run:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;before&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/infiniband/mlx5_0/ports/1/counters/port_xmit_data&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:1:node ./osu_bw &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; 8388608:8388608 &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;/dev/null
&lt;span class=&quot;nv&quot;&gt;after&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/infiniband/mlx5_0/ports/1/counters/port_xmit_data&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;delta: &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt; after &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; before &lt;span class=&quot;k&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Causes, in the order they are usually found: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ulimit -l&lt;/code&gt; not unlimited; a device
name in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_NET_DEVICES&lt;/code&gt; that does not exist on some nodes; a node with a
different OFED; a port that is down on one node; and, on GPU nodes, a CUDA-aware
build mismatch that causes UCX to reject the RDMA path for device buffers.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Put the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_TLS=rc_x,sm,self&lt;/code&gt; run in your acceptance suite as a pass/fail gate.
It costs seconds and it converts the single most damaging silent degradation into
a loud, obvious failure. Almost nobody does this, and it is the highest-value
five lines in an MPI test harness.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;fails-only-above-a-certain-scale&quot;&gt;Fails only above a certain scale&lt;/h2&gt;

&lt;p&gt;A job that works at 8 nodes and fails at 64 is usually a resource that scales
with the square of the rank count.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reliable Connection queue pairs.&lt;/strong&gt; With RC, each rank maintains a QP to each
peer it talks to. Full connectivity across &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;n&lt;/code&gt; ranks is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;n²&lt;/code&gt; QPs, and each
consumes adapter and host resources. On a node running many ranks, this becomes
the constraint well before the fabric does.&lt;/p&gt;

&lt;p&gt;Dynamically Connected transport solves it by multiplexing:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_TLS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;dc_x,sm,self &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_NET_DEVICES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mlx5_0:1 ./a.out
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If a job fails at high ranks-per-node with connection or resource errors and
succeeds with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dc_x&lt;/code&gt;, that was it. Note that DC availability depends on the
adapter generation, and that the failure mode when DC resources themselves are
exhausted is different and less obvious — usually a hang rather than an error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory registration limits.&lt;/strong&gt; Large registered regions need translation table
entries. The relevant firmware parameters differ by adapter and driver
generation; the symptom is a registration failure at a size or rank count that
worked before.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Aggregate memory per node.&lt;/strong&gt; Each connection carries buffers. At high
ranks-per-node, MPI’s own buffer footprint becomes significant, and the job dies
of OOM in a way that looks like an application memory bug. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dmesg&lt;/code&gt; on the node
that died settles it in one line.&lt;/p&gt;

&lt;h2 id=&quot;one-rank-is-always-late&quot;&gt;One rank is always late&lt;/h2&gt;

&lt;p&gt;A collective takes as long as its slowest participant, so one degraded node
degrades everything. Finding it is mechanical.&lt;/p&gt;

&lt;p&gt;Bisection is fastest: split the allocation, run both halves, keep the slow half,
repeat. Six rounds for 64 nodes.&lt;/p&gt;

&lt;p&gt;The systematic version tests every node against one reference, at the verbs layer
so MPI is not in the picture:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;REF&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;node001
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;n &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;scontrol show hostnames &lt;span class=&quot;nv&quot;&gt;$SLURM_JOB_NODELIST&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;continue
  &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;bw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;ssh &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ib_write_bw -d mlx5_0 -F -s 1048576 -D 5 --report_gbits &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;/1048576/ {print $4}&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$bw&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-k2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once you have the node, the causes are a short list:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Narrow or degraded link — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlxlink -d mlx5_0 -p 1 --show_fec&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Downtrained PCIe slot — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lspci -vv | grep LnkSta&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;CPU frequency capping or thermal throttling — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;turbostat&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cpupower
frequency-info&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dmesg | grep -i thermal&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;A daemon on a core that a rank is pinned to.&lt;/li&gt;
  &lt;li&gt;Memory running at a lower speed, or a DIMM that failed into a degraded
configuration — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dmidecode -t memory&lt;/code&gt;, and the platform’s own health log.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the last point about cores: &lt;strong&gt;aggregate CPU idle proves nothing on a many-core
node.&lt;/strong&gt; One rank spinning uselessly on a 192-core machine is half a percent of
system-wide CPU. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;top&lt;/code&gt; shows a healthy node. Look per-core:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpstat &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; ALL 1 5
pidstat &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;pgrep &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; a.out&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt; 1 5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;timings-vary-wildly-between-runs&quot;&gt;Timings vary wildly between runs&lt;/h2&gt;

&lt;p&gt;Before treating variance as a signal, establish that it is not the experiment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The allocation changed.&lt;/strong&gt; Different nodes, different leaves, different number
of spine crossings. This is the most common cause by a wide margin. Record
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scontrol show hostnames $SLURM_JOB_NODELIST&lt;/code&gt; with every result and compare.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other jobs share the fabric.&lt;/strong&gt; Exclusive node allocation does not give you
exclusive links. Another job’s alltoall on the same spine uplinks changes your
result, and you have no visibility into it from inside your job. If you are
producing numbers that matter, get an exclusive fabric window, or at minimum
record what else was running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cached or warm state.&lt;/strong&gt; The first iteration of anything includes connection
setup and memory registration. Every benchmark here has a warmup flag; use it.
Where filesystem I/O is in the loop, a repeat run served from page cache is not a
measurement of anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OS jitter.&lt;/strong&gt; Unpinned ranks, an unsynchronized housekeeping daemon, a
monitoring agent that wakes every thirty seconds. Collectives amplify jitter
because every rank waits for the one that was interrupted. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--bind-to core&lt;/code&gt; and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--report-bindings&lt;/code&gt; first; if variance persists with clean binding, look at what
runs on the compute nodes on a timer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Power and frequency policy.&lt;/strong&gt; A node that boosts for the first thirty seconds
and then settles produces a benchmark whose result depends on its duration.
Fix the governor for measurement runs and record what it was.&lt;/p&gt;

&lt;p&gt;A run-to-run spread you cannot get under a few percent is not a slow cluster. It
is an uncontrolled experiment, and no amount of tuning against it will converge.&lt;/p&gt;

&lt;h2 id=&quot;bandwidth-that-is-a-clean-fraction-of-expectation&quot;&gt;Bandwidth that is a clean fraction of expectation&lt;/h2&gt;

&lt;p&gt;Half, a quarter, a tenth. Clean fractions have mechanical causes and are worth a
minute of arithmetic before any investigation.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Fraction&lt;/th&gt;
      &lt;th&gt;Look at&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Exactly half&lt;/td&gt;
      &lt;td&gt;Link width 2X not 4X; one rail of two in use; PCIe x8 not x16&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Exactly a quarter&lt;/td&gt;
      &lt;td&gt;Link width 1X; PCIe x4; two independent halvings&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;About a tenth&lt;/td&gt;
      &lt;td&gt;TCP fallback, or IPoIB instead of RDMA&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;About 60 percent&lt;/td&gt;
      &lt;td&gt;Often real — protocol overhead plus an unsaturated single rank&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ibstatus mlx5_0 | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;rate
iblinkinfo &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; 4X
lspci &lt;span class=&quot;nt&quot;&gt;-vv&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &amp;lt;bdf&amp;gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;LnkCap|LnkSta&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;mtu&quot;&gt;MTU&lt;/h2&gt;

&lt;p&gt;On InfiniBand, path MTU is negotiated and normally 4096. On RoCE it is derived
from the Ethernet MTU, and a single hop at 1500 anywhere in the path drops the
RoCE MTU to 1024 with a real bandwidth cost.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; header prints what was actually negotiated, which is the number
to trust over any configuration file:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; Mtu             : 4096[B]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If that reads 1024 on a fabric you configured for jumbo frames, walk the path.
The offender is usually a recently added switch port or a host whose interface
configuration did not include the MTU.&lt;/p&gt;

&lt;p&gt;IPoIB has its own version of this — datagram mode caps at 2044 bytes while
connected mode allows much larger — which matters if any part of your workload,
including the scheduler or the filesystem, is running over IPoIB.&lt;/p&gt;

&lt;h2 id=&quot;after-a-maintenance-window&quot;&gt;After a maintenance window&lt;/h2&gt;

&lt;p&gt;Performance that changed after a window, with no application change, has a short
suspect list.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Firmware skew.&lt;/strong&gt; Some nodes were updated and some were not, or a node was
replaced with one from a different batch. Group by PSID and compare within
groups:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pdsh &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; node[001-256] &lt;span class=&quot;s1&quot;&gt;&apos;ibv_devinfo | grep -E &quot;fw_ver|board_id&quot;&apos;&lt;/span&gt; | dshbak &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The routing engine fell back.&lt;/strong&gt; A switch that was down during the sweep, or a
node cabled differently on the way back in, can make &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftree&lt;/code&gt; decline the topology
and fall back to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updn&lt;/code&gt; for the entire fabric. The subnet manager logs it and
nobody reads it:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-iE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;routing engine|fallback|ftree&apos;&lt;/span&gt; /var/log/opensm.log | &lt;span class=&quot;nb&quot;&gt;tail&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-40&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;A standby subnet manager took over.&lt;/strong&gt; If the standby holds an older
configuration, the whole fabric is now routed by that configuration. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sminfo&lt;/code&gt;
tells you which SM is master.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A driver or kernel change altered defaults.&lt;/strong&gt; UCX and OFED defaults do move
between releases. Diff the effective configuration, not the configuration files:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ucx_info &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /var/tmp/ucx-&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; +%F&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;.conf
diff /var/tmp/ucx-&amp;lt;previous&amp;gt;.conf /var/tmp/ucx-&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; +%F&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;error-messages-worth-recognizing&quot;&gt;Error messages worth recognizing&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IBV_WC_RETRY_EXC_ERR&lt;/code&gt; / “Retry exceeded”.&lt;/strong&gt; The sender gave up after
retransmitting. On InfiniBand, this usually means the peer died or a link went
down mid-transfer. On RoCE, it much more often means the fabric is dropping —
PFC not enabled on the RoCE priority, or a mismatched trust mode. Go to the
per-priority discard counters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RNR retry exceeded&lt;/code&gt;.&lt;/strong&gt; The receiver had no buffer posted and kept saying so
until the sender gave up. Usually an application or middleware issue rather than
a fabric one, though severe congestion can produce it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fork()&lt;/code&gt; warning.&lt;/strong&gt; Registered memory and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fork()&lt;/code&gt; interact badly. If your
application or a library it calls forks after registering memory, you get either
a warning or corruption. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibv_fork_init&lt;/code&gt; and the corresponding MPI settings exist
for this; a job that calls out to shell commands from inside a rank is the usual
trigger.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX ERROR ... Connection reset by remote peer&lt;/code&gt;.&lt;/strong&gt; A peer rank died. Find out
why that rank died; the UCX error is a consequence, not a cause. Check &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dmesg&lt;/code&gt; on
its node for OOM.&lt;/p&gt;

&lt;h2 id=&quot;the-habit-that-shortens-all-of-this&quot;&gt;The habit that shortens all of this&lt;/h2&gt;

&lt;p&gt;Keep a baseline file, in version control, per cluster:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;OFED, firmware and PSID per node group&lt;/li&gt;
  &lt;li&gt;PCIe &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LnkSta&lt;/code&gt; per adapter&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_read_bw&lt;/code&gt; plateaus for a named intra-leaf and cross-spine
pair&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_latency&lt;/code&gt; at 8 bytes and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; at 8 MB&lt;/li&gt;
  &lt;li&gt;Allreduce and alltoall curves at the job sizes you run, with node lists&lt;/li&gt;
  &lt;li&gt;The width-and-rate histogram for the whole fabric&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Regenerate the baseline after maintenance and retain the previous version. Compare an incident against the matching node group and software stack before starting a fresh investigation.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>EDR to XDR in one fabric: rate reporting, width traps, and the node that gates the job</title>
    <link href="https://www.wirewalk.com/writing/mpi-mixed-generation-fabrics/"/>
    <published>2026-09-09T09:00:00-04:00</published>
    <updated>2026-09-09T09:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/mpi-mixed-generation-fabrics/</id>
    <summary>Different tools report link speed in different units, half the field is per-lane, and a link that negotiated two lanes instead of four is Active and silent. On a synchronized collective, one such link sets the speed of the entire job.</summary>
    <content type="html">&lt;p&gt;An older EDR island may still run production while HDR, NDR and an XDR GPU tier are added around it. The generations can coexist, but their tools do not always report rates and widths in the same way. Inventory the actual links before applying expectations from a single-generation fabric.&lt;/p&gt;

&lt;h2 id=&quot;the-rate-table-and-which-number-each-tool-prints&quot;&gt;The rate table, and which number each tool prints&lt;/h2&gt;

&lt;p&gt;Read the rate and width together, and establish which unit each tool is printing.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Generation&lt;/th&gt;
      &lt;th&gt;Lanes&lt;/th&gt;
      &lt;th&gt;Per-lane signalling&lt;/th&gt;
      &lt;th&gt;4X link rate&lt;/th&gt;
      &lt;th&gt;Encoding&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;FDR&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
      &lt;td&gt;14.0625 Gb/s&lt;/td&gt;
      &lt;td&gt;56 Gb/s&lt;/td&gt;
      &lt;td&gt;64b/66b&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;EDR&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
      &lt;td&gt;25.78125 Gb/s&lt;/td&gt;
      &lt;td&gt;100 Gb/s&lt;/td&gt;
      &lt;td&gt;64b/66b&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;HDR&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
      &lt;td&gt;53.125 Gb/s&lt;/td&gt;
      &lt;td&gt;200 Gb/s&lt;/td&gt;
      &lt;td&gt;PAM4, 64b/66b + RS-FEC&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;NDR&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
      &lt;td&gt;106.25 Gb/s&lt;/td&gt;
      &lt;td&gt;400 Gb/s&lt;/td&gt;
      &lt;td&gt;PAM4, RS-FEC&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;XDR&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
      &lt;td&gt;212.5 Gb/s&lt;/td&gt;
      &lt;td&gt;800 Gb/s&lt;/td&gt;
      &lt;td&gt;PAM4, RS-FEC&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Now the part that matters. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibstat&lt;/code&gt; prints the &lt;strong&gt;aggregate link rate&lt;/strong&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;	Rate: 400
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibstatus&lt;/code&gt; prints the aggregate rate and helpfully names the generation:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;	rate:            400 Gb/sec (4X NDR)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt; prints the &lt;strong&gt;width and the per-lane rate as separate fields&lt;/strong&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  37   12[  ] ==( 4X 106.25 Gbps Active/  LinkUp)==&amp;gt;  91   1[  ] &quot;node17 mlx5_0&quot; ( )
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is a 400 Gb/s link. Read the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;106.25&lt;/code&gt; as the link rate and you conclude
your NDR fabric is running at roughly 100 Gb/s, which is a conclusion people
reach, escalate, and occasionally publish. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4X&lt;/code&gt; prefix is doing the work and
it is easy to skim past.&lt;/p&gt;

&lt;p&gt;On a mixed fabric this is worse, because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4X 106.25 Gbps&lt;/code&gt; (NDR400) and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4X 25.78125 Gbps&lt;/code&gt; (EDR100) look superficially similar in a long scan and the
distinguishing digits are in the middle of the field.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;The rule that keeps this straight: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibstat&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibstatus&lt;/code&gt; report the link, and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt; reports a lane. Whenever you quote a number from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt;,
quote the width with it. A capacity claim sourced from that field without the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4X&lt;/code&gt; attached is wrong by a factor of four, and it is wrong in the direction
that makes people buy hardware.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-width-trap&quot;&gt;The width trap&lt;/h2&gt;

&lt;p&gt;Width is the field that silently costs you three quarters of a link.&lt;/p&gt;

&lt;p&gt;An InfiniBand link can negotiate 1X, 2X or 4X. A link that comes up at 1X is
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Active&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LinkUp&lt;/code&gt;, routable, pingable, and passes every functional test. It runs
at a quarter rate. Nothing logs an error, because from the fabric’s point of view
nothing is wrong — the two ends negotiated the best width they could agree on,
and that is what negotiation is for.&lt;/p&gt;

&lt;p&gt;Causes: a damaged or partially seated cable, a transceiver with a failed lane, a
splitter cable in a port that is not configured to split, or a port configured to
split that has a straight cable in it.&lt;/p&gt;

&lt;p&gt;The scan to run across the whole fabric, on a schedule:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;iblinkinfo &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;$0 !~ /4X/ &amp;amp;&amp;amp; /Active/ {print}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the more useful version, which catches both narrow links and links that
negotiated a lower generation than they should have:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;iblinkinfo &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-oE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;[0-9]+X +[0-9.]+ Gbps&apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;tr&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos; &apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;uniq&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That gives you a histogram of every distinct width-and-rate combination in the
fabric. On a homogeneous fabric it should have one row. On a mixed fabric it
should have exactly as many rows as you have generations, and every count should
match what you cabled. Any row with a small count is the anomaly, and small
counts are the whole point of the histogram.&lt;/p&gt;

&lt;h2 id=&quot;hdr100-and-the-two-ways-to-get-it&quot;&gt;HDR100 and the two ways to get it&lt;/h2&gt;

&lt;p&gt;HDR100 is the case where the same nominal rate arrives by two different physical
arrangements, and the difference matters when you are diagnosing.&lt;/p&gt;

&lt;p&gt;An HDR switch port carries four HDR lanes. Split, it presents as two ports of two
lanes each — HDR100, reported as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2X 53.125 Gbps&lt;/code&gt;. Separately, there are HDR100
adapters, which are physically capable of two lanes only and report &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2X&lt;/code&gt; even
into an unsplit port.&lt;/p&gt;

&lt;p&gt;So &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2X 53.125 Gbps&lt;/code&gt; is normal and expected on a split fabric with HDR100
adapters, and is a fault on a fabric where you believed everything was HDR200.
The histogram above is what tells you which situation you are in; the individual
port reading does not.&lt;/p&gt;

&lt;p&gt;Three practical consequences:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A single HDR200 adapter plugged into a split HDR100 port runs at 100. Half of
the adapter is unused and nothing reports it.&lt;/li&gt;
  &lt;li&gt;A single HDR100 adapter plugged into an unsplit HDR200 port also runs at 100,
and wastes half a switch port.&lt;/li&gt;
  &lt;li&gt;Cable compatibility is not guaranteed across these arrangements. Active optical
cables in particular have power class requirements that some port and adapter
combinations do not satisfy, and the symptom is a port that will not come out of
Polling with no error message that explains why. Check the transceiver
explicitly before assuming a bad cable:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mlxlink &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; mlx5_0 &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That reports the module’s vendor, part number, type and supported rates, which
is the information the failure message does not give you.&lt;/p&gt;

&lt;h2 id=&quot;when-one-node-gates-the-job&quot;&gt;When one node gates the job&lt;/h2&gt;

&lt;p&gt;This is the expensive lesson, and it is the reason the width scan belongs on a
schedule rather than in a runbook.&lt;/p&gt;

&lt;p&gt;A synchronized collective — allreduce, alltoall, a barrier before a timing
region — completes when its slowest participant completes. The whole job
proceeds at the rate of its worst link. One node at 2X in a 32-node NDR
allocation does not cost you one thirty-second of the throughput. Depending on
the communication pattern, it can cost a large fraction of it, because every
other rank waits.&lt;/p&gt;

&lt;p&gt;What makes it expensive is not the degradation, it is the presentation. The
symptom is:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Results that vary between runs by a wide margin.&lt;/li&gt;
  &lt;li&gt;The variation correlating with nothing you changed.&lt;/li&gt;
  &lt;li&gt;Point-to-point tests that are clean, because the odds of any given pair
including the bad node are low.&lt;/li&gt;
  &lt;li&gt;Fabric-wide diagnostics that report no errors, because a narrow link is not an
error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It presents as a fabric-wide capacity problem. It gets investigated as one. The
routing engine gets blamed, ISL capacity gets blamed, a purchase order for more
spine ports gets discussed — and the actual finding is one transceiver.&lt;/p&gt;

&lt;p&gt;The tell is the correlation with allocation. If you keep the node list with every
result, the correlation is visible in an afternoon. If you do not, it is not
visible at all, which is why the earlier articles in this series keep insisting
on recording the node list.&lt;/p&gt;

&lt;p&gt;The other tell is arithmetic. If a synchronized benchmark comes in at close to a
clean fraction of expectation — half, a quarter — suspect a width negotiation
before suspecting anything subtle. Fabrics rarely degrade by exactly 50 percent
for interesting reasons.&lt;/p&gt;

&lt;h2 id=&quot;mixing-generations-in-one-subnet&quot;&gt;Mixing generations in one subnet&lt;/h2&gt;

&lt;p&gt;Several things happen that are worth anticipating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links negotiate down to the lower common generation.&lt;/strong&gt; An NDR adapter into an
HDR switch port gives HDR, with the appropriate cable. That is correct behavior
and it is only a problem when nobody recorded the intent, and a year later
somebody is trying to work out why a node is at 200 when the inventory says 400.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Path MTU is set by the minimum along the path.&lt;/strong&gt; OpenSM computes per-path MTU,
so a subnet containing something that supports only 2048 will have paths through
it at 2048 while other paths run at 4096. Two node pairs then produce different
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; headers on the same fabric, which is confusing if you have not
seen it before. Check the SM’s configured maximum and the per-device capability:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; max_mtu /etc/opensm/opensm.conf
ibv_devinfo &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;max_mtu|active_mtu&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Service levels and virtual lanes may differ.&lt;/strong&gt; The number of data VLs a device
supports varies across generations. If you use QoS and service-level mapping,
the mapping has to be valid on the least capable device in the path, and an
invalid mapping does not fail loudly — traffic lands on VL0 with everything
else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The routing engine is constrained by the least regular part of the fabric.&lt;/strong&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftree&lt;/code&gt; requires a regular fat tree; an older island bolted on with a different
uplink ratio is exactly the sort of irregularity that makes it decline and fall
back to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updn&lt;/code&gt;, fabric-wide. So adding a generation can change the routing of
the parts you did not touch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forwarding table capacity is set by the oldest switch.&lt;/strong&gt; Every switch needs an
entry for every LID it must reach. The smallest table in the fabric governs, and
older switches have smaller tables. The article on LID budgets in this series
covers the arithmetic.&lt;/p&gt;

&lt;h2 id=&quot;firmware-skew-across-a-mixed-fleet&quot;&gt;Firmware skew across a mixed fleet&lt;/h2&gt;

&lt;p&gt;Mixed generations mean multiple firmware trains, and mixed firmware within a
single model is where the odd behavior lives.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pdsh &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; node[001-256] &lt;span class=&quot;s1&quot;&gt;&apos;ibv_devinfo | grep -E &quot;hca_id|fw_ver|board_id&quot;&apos;&lt;/span&gt; | dshbak &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt;
mlxfwmanager &lt;span class=&quot;nt&quot;&gt;--query&lt;/span&gt;
flint &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4123_pciconf0 q
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Group by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;board_id&lt;/code&gt; — the PSID — not by model name. Within a PSID group, the
firmware version should be identical. Across PSID groups it will not be and
should not be expected to be. The check is uniformity within a group, and the
detail of doing the update is covered in the ConnectX firmware article in this
series.&lt;/p&gt;

&lt;p&gt;Skew within a group is worth taking seriously because the symptoms are
generation-specific and unhelpful: a link that trains at a lower width with one
firmware and correctly with another, a counter that reads differently, a
congestion-control feature present on some cards and not others.&lt;/p&gt;

&lt;h2 id=&quot;physical-quality-which-is-different-from-link-state&quot;&gt;Physical quality, which is different from link state&lt;/h2&gt;

&lt;p&gt;A link can be at full width and full rate and still be marginal. Forward error
correction hides a great deal, and it hides it right up until the offered load
is high enough that it cannot.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mlxlink &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; mlx5_0 &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--show_fec&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--show_eye&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--show_counters&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The fields to compare across the fleet are raw BER, effective BER, and the FEC
histogram if the tool provides one for your device. A port whose raw BER is
orders of magnitude worse than its peers while its effective BER is clean is a
link that FEC is currently rescuing. It will pass every functional test. It is
also the one that will produce intermittent, load-correlated performance
problems that no configuration change fixes.&lt;/p&gt;

&lt;p&gt;Comparing across the fleet is the essential part. A raw BER figure in isolation
is hard to judge; the same figure alongside sixty-three peers is obvious.&lt;/p&gt;

&lt;h2 id=&quot;practical-policy-for-a-mixed-estate&quot;&gt;Practical policy for a mixed estate&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Keep generations in separate scheduler partitions and separate topology
groups.&lt;/strong&gt; A job that straddles an NDR island and an EDR island runs at EDR, and
the user will not know why. Make the boundary explicit in the scheduler rather
than implicit in the fabric.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run the width and rate histogram on a schedule&lt;/strong&gt; and alert on any change to
the row counts. It is one command, it is cheap, and it converts the most
expensive class of quiet failure into a notification.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Record intent alongside the fabric.&lt;/strong&gt; For every link that is deliberately at a
lower rate than the adapter supports, write down why. Otherwise every future
audit rediscovers it as an anomaly and someone eventually “fixes” it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Baseline &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlxlink&lt;/code&gt; output per port&lt;/strong&gt; at install and compare periodically. The comparison can reveal a link degrading before it fails outright.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>MPI on InfiniBand and on Spectrum-X: what transfers and what does not</title>
    <link href="https://www.wirewalk.com/writing/mpi-infiniband-vs-spectrumx/"/>
    <published>2026-09-08T14:00:00-04:00</published>
    <updated>2026-09-08T14:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/mpi-infiniband-vs-spectrumx/</id>
    <summary>The MPI layer looks identical on both. Everything underneath it is different, and on the Ethernet side a single hop configured wrongly degrades collectives across the entire fabric while every link reports healthy.</summary>
    <content type="html">&lt;p&gt;Running MPI over an Ethernet fabric with RoCEv2 and running it over InfiniBand
look the same from the application. Same verbs API, same UCX, same Open MPI,
same OSU benchmarks, same &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt;. The adapter presents an
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/sys/class/infiniband/&lt;/code&gt; device either way, which is why so much tooling appears
to be portable.&lt;/p&gt;

&lt;p&gt;What is not portable is everything that makes the fabric lossless, and that is
where the operational differences live. On InfiniBand, link-level flow control
is built into the architecture and is on by default. On Ethernet it is a
configuration you have to get right on every port of every switch and every NIC
in the path, and getting it wrong on one hop degrades the whole fabric.&lt;/p&gt;

&lt;h2 id=&quot;the-concept-mapping&quot;&gt;The concept mapping&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;InfiniBand&lt;/th&gt;
      &lt;th&gt;Ethernet / RoCEv2&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Subnet manager assigns LIDs and computes routes&lt;/td&gt;
      &lt;td&gt;No SM. L3 routing, BGP/ECMP, ARP and neighbour discovery&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Credit-based link flow control, always on&lt;/td&gt;
      &lt;td&gt;PFC (802.1Qbb) per priority, configured per port&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Congestion control notification (CCT/CCTI), rarely enabled&lt;/td&gt;
      &lt;td&gt;ECN marking plus CNP, and DCQCN on the NIC — normally mandatory&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibstat&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibdiagnet&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ethtool -S&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlnx_qos&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lldpctl&lt;/code&gt;, switch telemetry&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Path MTU 256–4096, negotiated&lt;/td&gt;
      &lt;td&gt;RoCE MTU derived from the L2 MTU; jumbo frames needed for 4096&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Static routing by default; adaptive routing a switch feature&lt;/td&gt;
      &lt;td&gt;ECMP by flow hash; Spectrum-X adds per-packet adaptive routing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Fabric is a single administrative object&lt;/td&gt;
      &lt;td&gt;Fabric is an IP network, with everything that implies&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Everything in the left column that you know how to use has an equivalent in the
right column that behaves differently enough to catch you out.&lt;/p&gt;

&lt;h2 id=&quot;what-spectrum-x-changes-about-the-ethernet-side&quot;&gt;What Spectrum-X changes about the Ethernet side&lt;/h2&gt;

&lt;p&gt;Plain RoCEv2 on general-purpose Ethernet is workable and fragile. The fragility
comes from two places: PFC is a blunt instrument that spreads congestion
backwards through the fabric, and ECMP hashes flows onto links, so a small
number of large elephant flows — which is exactly what a collective produces —
can collide on one link while others sit idle.&lt;/p&gt;

&lt;p&gt;Spectrum-X addresses both. The switch performs adaptive routing at packet
granularity rather than flow granularity, spreading a single flow’s packets
across available paths, and the NIC handles the resulting out-of-order arrival
and places data correctly without the sender having to care. Congestion control
is done in coordination between switch telemetry and the NIC rather than by the
generic DCQCN loop alone.&lt;/p&gt;

&lt;p&gt;The practical consequence for MPI is that the ECMP collision problem — the one
that makes plain RoCE alltoall performance erratic — is substantially addressed
by the platform rather than by your hashing configuration. The PFC and ECN
configuration discipline does not go away.&lt;/p&gt;

&lt;p&gt;Treat the specific feature names and defaults for your switch OS release as
authoritative over anything written here. What is stable is the shape of the
problem, not the syntax.&lt;/p&gt;

&lt;h2 id=&quot;pfc-and-why-one-hop-matters&quot;&gt;PFC, and why one hop matters&lt;/h2&gt;

&lt;p&gt;Priority Flow Control sends a PAUSE frame for a specific traffic class when a
port’s ingress buffer for that class fills. It is hop-by-hop: the upstream
device stops sending that class until the pause expires or is canceled.&lt;/p&gt;

&lt;p&gt;Two properties make it treacherous.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It is per-priority, and the priority has to match end to end.&lt;/strong&gt; The NIC marks
RoCE traffic with a DSCP value or a PCP value; the switch maps that to a traffic
class; PFC is enabled on that class. Break the chain at any point — one switch
that trusts PCP where the NIC is marking DSCP, one port where PFC was never
enabled on priority 3, one uplink that was added later from a different template
— and RoCE traffic on that hop lands in a lossy class. It then drops under
congestion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A drop is far more expensive than it looks.&lt;/strong&gt; RoCE’s reliable connection
transport recovers from loss, but recovery costs a round trip and, on older
implementations, a retransmission of everything after the lost packet. A drop
rate that would be invisible to TCP is enough to flatten collective performance.&lt;/p&gt;

&lt;p&gt;And because a collective completes when its slowest participant completes, a
single misconfigured hop that affects a handful of flows degrades the whole job.
This is the mechanism behind the most confusing class of RoCE incident: every
link is up, no interface shows errors, throughput between any two nodes you test
is fine, and the alltoall is half what it should be.&lt;/p&gt;

&lt;h3 id=&quot;checking-the-chain&quot;&gt;Checking the chain&lt;/h3&gt;

&lt;p&gt;On the NIC:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mlnx_qos &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; enp1s0f0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;DCBX mode: OS controlled
Priority trust state: dscp
Cable len: 7
PFC configuration:
	priority    0   1   2   3   4   5   6   7
	enabled     0   0   0   1   0   0   0   0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two lines matter. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Priority trust state&lt;/code&gt; must agree with what the switch is
trusting. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PFC configuration&lt;/code&gt; must have the RoCE priority enabled and must agree
with the switch’s per-port configuration.&lt;/p&gt;

&lt;p&gt;Set it explicitly rather than inheriting:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mlnx_qos &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; enp1s0f0 &lt;span class=&quot;nt&quot;&gt;--trust&lt;/span&gt; dscp
mlnx_qos &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; enp1s0f0 &lt;span class=&quot;nt&quot;&gt;--pfc&lt;/span&gt; 0,0,0,1,0,0,0,0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Confirm what the RoCE traffic is actually marked with:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/net/enp1s0f0/ecn/roce_np/cnp_dscp
cma_roce_tos &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; mlx5_0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then read the pause counters after a run. These are the evidence that PFC is
being exercised, and whether it is being exercised on the priority you intended:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ethtool &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; enp1s0f0 | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;prio[0-7]_(pause|buf_discard)&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rx_prio3_pause: 148213
rx_prio3_pause_duration: 3320119
tx_prio3_pause: 96204
tx_prio3_pause_duration: 1904772
rx_prio0_buf_discard: 0
rx_prio3_buf_discard: 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Read it as follows. Pause counts on priority 3 that are non-zero and growing
mean PFC is active and congestion is real — that is the mechanism working, not a
fault, though sustained heavy pausing means the fabric is oversubscribed for the
offered load. A non-zero &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;buf_discard&lt;/code&gt; on the RoCE priority means packets were
dropped in a class that was supposed to be lossless, which is a configuration
failure. And pause counters on priority 0 while RoCE was running means your
traffic is not in the class you think it is.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;The counter that most often reveals the problem is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rx_prio0_pause&lt;/code&gt; being
non-zero on a fabric that was configured for RoCE on priority 3. It means the
marking or the trust mode is wrong somewhere, and the traffic is being pause-
controlled — or not — in the default class. Every link is up, nothing logs an
error, and the collectives are poor.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ecn-and-dcqcn&quot;&gt;ECN and DCQCN&lt;/h2&gt;

&lt;p&gt;PFC stops congestion at the cost of pushing it upstream. ECN is the mechanism
that instead tells the sender to slow down, and it is what you want doing most of
the work, with PFC as the last resort that prevents loss.&lt;/p&gt;

&lt;p&gt;The loop: the switch marks packets ECN-CE when its queue exceeds a threshold; the
receiving NIC sees the mark and returns a Congestion Notification Packet; the
sending NIC reduces its rate for that queue pair and then recovers according to
the DCQCN parameters.&lt;/p&gt;

&lt;p&gt;The switch side is a WRED-style configuration with a minimum threshold, a
maximum threshold and a marking probability, per queue. Those numbers are the
main tuning lever and they interact with buffer size, link rate and round-trip
time, so they are genuinely site-specific — a setting tuned for a two-tier
100 GbE fabric is not right for a 400 GbE one.&lt;/p&gt;

&lt;p&gt;The NIC side lives in sysfs:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; /sys/class/net/enp1s0f0/ecn/roce_np/    &lt;span class=&quot;c&quot;&gt;# notification point (receiver)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; /sys/class/net/enp1s0f0/ecn/roce_rp/    &lt;span class=&quot;c&quot;&gt;# reaction point (sender)&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/net/enp1s0f0/ecn/roce_np/enable/3
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/net/enp1s0f0/ecn/roce_rp/enable/3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Both must be enabled on the RoCE priority, on every node. A node with the
reaction point disabled does not slow down when told to, which means it wins
against its better-behaved neighbours and drives the fabric into PFC. One such
node in a large allocation is enough to make the whole job’s timing erratic, and
it is a difficult thing to suspect if you are not looking for it.&lt;/p&gt;

&lt;p&gt;The counters that show the loop working:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ethtool &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; enp1s0f0 | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;cnp|ecn&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;np_ecn_marked_roce_packets: 41229
np_cnp_sent: 40871
rp_cnp_handled: 39655
rp_cnp_ignored: 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;np_ecn_marked_roce_packets&lt;/code&gt; rising means the switch is marking, so ECN is
configured on the switch and the path. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;np_cnp_sent&lt;/code&gt; should track it closely.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rp_cnp_handled&lt;/code&gt; rising on the senders means they are reacting. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rp_cnp_ignored&lt;/code&gt;
being non-zero means CNPs are arriving for queue pairs that no longer exist or
in a state where they cannot be acted on, and a large value is worth
investigating.&lt;/p&gt;

&lt;p&gt;The failure signature to recognize: marking is happening, CNPs are being sent,
and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rp_cnp_handled&lt;/code&gt; is zero or near it. The sending side is not reacting — the
reaction point is disabled, or the CNPs are being lost or misclassified on the
return path. CNPs themselves are typically marked with a different DSCP and
should be in a high-priority, non-paused class; if they are queued behind the
congestion they are meant to relieve, the control loop does not close.&lt;/p&gt;

&lt;p&gt;There are also hardware counters on the RDMA device side, which are per-device
rather than per-netdev and sometimes easier to correlate with a specific job:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; /sys/class/infiniband/mlx5_0/ports/1/hw_counters/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;out_of_buffer|out_of_sequence|packet_seq_err|local_ack_timeout_err|rnr_nak|np_cnp|rp_cnp|roce_adp_retrans&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;packet_seq_err&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;out_of_sequence&lt;/code&gt; are the ones to watch. On a fabric that is
genuinely lossless they stay near zero. On Spectrum-X with packet-level adaptive
routing, out-of-order arrival is expected and handled, so interpret these against
the platform’s own guidance rather than against an InfiniBand intuition.&lt;/p&gt;

&lt;h2 id=&quot;mtu&quot;&gt;MTU&lt;/h2&gt;

&lt;p&gt;This is a small thing that costs a lot of bandwidth.&lt;/p&gt;

&lt;p&gt;RoCE selects a path MTU from the standard set — 256, 512, 1024, 2048 or 4096
bytes — and it cannot exceed what the underlying Ethernet MTU can carry once
headers are accounted for. If any hop in the path is at the default 1500, the
RoCE MTU drops to 1024, and you lose a meaningful fraction of achievable
bandwidth to per-packet overhead and processing.&lt;/p&gt;

&lt;p&gt;The requirement is jumbo frames configured consistently on every NIC and every
switch port in the path, typically 9000. One port left at 1500 — a newly added
uplink, a replaced switch, a host that did not get the configuration — is enough.&lt;/p&gt;

&lt;p&gt;Confirm what was negotiated rather than what was configured:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ib_write_bw &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; mlx5_0 &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; 3 &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--report_gbits&lt;/span&gt; &amp;lt;server&amp;gt;   &lt;span class=&quot;c&quot;&gt;# header prints Mtu&lt;/span&gt;
ip &lt;span class=&quot;nb&quot;&gt;link &lt;/span&gt;show enp1s0f0 | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;mtu
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-x 3&lt;/code&gt; selects a GID index, which on RoCE selects the RoCEv2 IPv4 or IPv6
entry. Get it from:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;show_gids
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Picking the wrong GID index is how people accidentally benchmark RoCEv1, or run
over link-local IPv6 when they meant to use the routed IPv4 address.&lt;/p&gt;

&lt;h2 id=&quot;what-transfers-between-the-two-worlds&quot;&gt;What transfers between the two worlds&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Transfers cleanly:&lt;/strong&gt; the MPI layer entirely — Open MPI, MPICH, UCX, PMIx, the
OSU benchmarks, your application. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perftest&lt;/code&gt; works on both with the addition of a
GID index. NCCL works on both, and refers to RoCE devices through the same
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NCCL_IB_HCA&lt;/code&gt; variable, which confuses people into thinking they have InfiniBand.
The layered testing order from the first article in this series applies without
modification.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does not transfer:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibstat&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibdiagnet&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibnetdiscover&lt;/code&gt;,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opensm&lt;/code&gt; and everything built on LIDs and the subnet manager. There
is no routing engine to choose and no LID budget to compute. In their place you
have per-priority counters, switch telemetry, LLDP for topology discovery, and
whatever your switch vendor’s fabric management provides.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transfers, but means something different:&lt;/strong&gt; latency figures. RoCE adds
UDP/IP encapsulation and the congestion-control loop, and end-to-end small-message
latency is generally higher than InfiniBand at an equivalent rate. How much
depends on the NIC generation and the switch, so measure it with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_send_lat&lt;/code&gt;
on your own hardware rather than accepting a figure. The gap has narrowed
considerably across recent generations; it has not closed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transfers, but with a different failure mode:&lt;/strong&gt; congestion. On InfiniBand,
credit-based flow control makes the fabric lossless without configuration, and a
congested fabric slows down. On Ethernet, an incorrectly configured fabric drops,
and RoCE recovery from drops is expensive enough that the performance cliff is
steep rather than gradual. That difference — gradual degradation versus a cliff —
is the single most important thing to internalize when moving MPI workloads from
one to the other.&lt;/p&gt;

&lt;h2 id=&quot;a-minimum-acceptance-check-on-the-ethernet-side&quot;&gt;A minimum acceptance check on the Ethernet side&lt;/h2&gt;

&lt;p&gt;Before believing any MPI number on a RoCE fabric:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlnx_qos -i &amp;lt;dev&amp;gt;&lt;/code&gt; on every node — trust mode and PFC priority identical
everywhere.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ecn/roce_np/enable/&amp;lt;prio&amp;gt;&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ecn/roce_rp/enable/&amp;lt;prio&amp;gt;&lt;/code&gt; set on every node.&lt;/li&gt;
  &lt;li&gt;MTU 9000 confirmed on every host interface and every switch port in the path,
and RoCE MTU 4096 confirmed in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; header.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;show_gids&lt;/code&gt; — the GID index in use is the RoCEv2 entry you intended.&lt;/li&gt;
  &lt;li&gt;Clear counters, run a full-scale alltoall, then check every node for
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;buf_discard&lt;/code&gt; on the RoCE priority and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rp_cnp_handled&lt;/code&gt; moving. Any discard on
the lossless class is a stop-and-fix.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Save those checks with the load-test result and repeat them after changes to the path. They provide a baseline for investigating performance that varies between allocations.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Multi-rail MPI: making the second adapter carry its share</title>
    <link href="https://www.wirewalk.com/writing/mpi-multirail-multileg/"/>
    <published>2026-09-08T09:00:00-04:00</published>
    <updated>2026-09-08T09:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/mpi-multirail-multileg/</id>
    <summary>A second rail is bought as a doubling and usually arrives as something well short of it. The reasons are enumerable, most of them are in the host rather than the fabric, and the first thing to establish is whether MPI is using the second adapter at all.</summary>
    <content type="html">&lt;p&gt;A second adapter adds another path, but doubling link capacity does not guarantee that an MPI job will run twice as fast. The application must use both paths, and the host’s PCIe, NUMA and memory resources must be able to sustain them together.&lt;/p&gt;

&lt;p&gt;Check those limits before blaming fabric overhead. The tests below distinguish an unused rail, a host bottleneck and a workload whose messages cannot benefit from striping.&lt;/p&gt;

&lt;h2 id=&quot;first-is-the-second-rail-carrying-anything-at-all&quot;&gt;First: is the second rail carrying anything at all?&lt;/h2&gt;

&lt;p&gt;Before tuning anything, establish whether the second adapter is being used. This
is not a rhetorical question — a substantial fraction of dual-rail nodes in
production are running every byte over one rail, and nothing reports it.&lt;/p&gt;

&lt;p&gt;The direct method is the port counters. Clear, run, read:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;d &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;mlx5_0 mlx5_1&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; before: &quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/infiniband/&lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt;/ports/1/counters/port_xmit_data
&lt;span class=&quot;k&quot;&gt;done

&lt;/span&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:1:node ./osu_bw &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; 8388608:8388608

&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;d &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;mlx5_0 mlx5_1&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; after: &quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/infiniband/&lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt;/ports/1/counters/port_xmit_data
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlx5_1&lt;/code&gt; did not move, you have a single-rail cluster with a spare adapter in
it. That is a two-minute check and it settles the question that the rest of the
work depends on.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Do this check before any tuning conversation. A node whose second adapter has
never transmitted a byte is not a multi-rail tuning problem, and the discussion
about striping thresholds and rendezvous rails that usually follows is entirely
beside the point. The counter delta settles it in two minutes.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The second method is to ask UCX what it selected:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:1:node &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_LOG_LEVEL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;info &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ./osu_bw 2&amp;gt;&amp;amp;1 | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-iE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;selected|device|transport|rndv&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Recent UCX releases also expose a protocol selection table that is considerably
more readable than the log:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_PROTO_INFO&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;y ./osu_bw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It prints, per message-size range, which protocol and which devices UCX will
use — including whether a large rendezvous transfer is being striped across
multiple devices or sent over one. That table answers the multi-rail question
directly rather than by inference.&lt;/p&gt;

&lt;h2 id=&quot;telling-mpi-which-devices-to-use&quot;&gt;Telling MPI which devices to use&lt;/h2&gt;

&lt;p&gt;UCX enumerates devices itself and its default selection is often not what you
want, particularly on a node that also has a management NIC, a storage NIC, or
an adapter whose port is administratively down.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ucx_info &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;^#.*Transport|Device:&apos;&lt;/span&gt;
ucx_info &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The device list to hand to MPI is explicit and includes the port number:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 16 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:8:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--mca&lt;/span&gt; pml ucx &lt;span class=&quot;nt&quot;&gt;--mca&lt;/span&gt; osc ucx &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_NET_DEVICES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mlx5_0:1,mlx5_1:1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_TLS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;rc_x,sm,self &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ./osu_bw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three parameters do most of the work:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_NET_DEVICES&lt;/code&gt; — the allowlist. Naming devices explicitly is better
practice than relying on discovery, because discovery changes when a port goes
down or a card is added.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_MAX_RNDV_RAILS&lt;/code&gt; — how many devices a single large (rendezvous) transfer
may be striped across. The default has historically been 2. If you have four
rails and want them all used by one transfer, this is the setting that is
quietly capping you.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_MAX_EAGER_RAILS&lt;/code&gt; — the same idea for the eager protocol used by smaller
messages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Confirm the values in effect rather than assuming the defaults:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ucx_info &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;MAX_RNDV_RAILS|MAX_EAGER_RAILS|NET_DEVICES|TLS&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;why-the-second-rail-underdelivers&quot;&gt;Why the second rail underdelivers&lt;/h2&gt;

&lt;p&gt;Work through these in order. They are roughly ordered by how often they are the
answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The transfer is not big enough to stripe.&lt;/strong&gt; Rail striping applies to the
rendezvous protocol. Messages below the rendezvous threshold go over one device.
An application whose messages are all 64 KB will not benefit from a second rail
no matter how it is configured, and that is a correct outcome rather than a
misconfiguration. Check where your application’s message sizes sit before
concluding anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Both adapters are on the same NUMA node.&lt;/strong&gt; Two cards on one socket share that
socket’s PCIe root complex, its memory bandwidth, and its inter-socket link for
any traffic sourced from the other socket. Check:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;d &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; /sys/class/infiniband/mlx5_&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;basename&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;: numa_node=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt;/device/numa_node&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;lstopo &lt;span class=&quot;nt&quot;&gt;--output-format&lt;/span&gt; txt
nvidia-smi topo &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;# on GPU nodes: also shows GPU-to-HCA affinity&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-smi topo -m&lt;/code&gt; is the one to read on a GPU node. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PIX&lt;/code&gt; means the GPU and
the adapter sit under the same PCIe switch, which is the case GPUDirect RDMA is
designed for. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NODE&lt;/code&gt; means same NUMA node but traversing the root complex.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SYS&lt;/code&gt; means the traffic crosses the inter-socket link, and on that pairing the
second rail is a good deal less than a second rail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The ranks are not bound to the rail that is local to them.&lt;/strong&gt; This is the
common and fixable case. If every rank uses both rails, half of every node’s
traffic crosses the inter-socket link. The better arrangement on a two-socket,
two-rail node is that ranks on socket 0 use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlx5_0&lt;/code&gt; and ranks on socket 1 use
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlx5_1&lt;/code&gt;, with no striping at all. That is not multi-rail in the striping sense;
it is rail affinity, and it usually outperforms naive striping.&lt;/p&gt;

&lt;p&gt;A small wrapper does it, driven by the local rank the launcher exports:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# rail-bind.sh - one rail per socket, selected by node-local rank&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;local_rank&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;OMPI_COMM_WORLD_LOCAL_RANK&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;SLURM_LOCALID&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}}&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;half&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt; OMPI_COMM_WORLD_LOCAL_SIZE &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$local_rank&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lt&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$half&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;UCX_NET_DEVICES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mlx5_0:1
&lt;span class=&quot;k&quot;&gt;else
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;UCX_NET_DEVICES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mlx5_1:1
&lt;span class=&quot;k&quot;&gt;fi
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$@&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 32 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:8:numa &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core ./rail-bind.sh ./osu_mbw_mr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Measure both arrangements. Which wins depends on the message-size distribution
and on whether the application is bandwidth- or latency-bound, and it is not
predictable from the topology alone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The PCIe slots cannot carry it.&lt;/strong&gt; Two NDR400 adapters is 100 GB/s of offered
load in each direction. Confirm both slots trained to their rated speed and
width, and confirm the platform is not sharing lanes between them:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lspci &lt;span class=&quot;nt&quot;&gt;-vv&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-A1&lt;/span&gt; Mellanox | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;LnkCap|LnkSta&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Both rails land on the same leaf switch and the same uplinks.&lt;/strong&gt; This is the
fabric-side case, and it is why some sites deliberately build the second rail as
a separate subnet with its own switches and its own subnet manager. If both
rails leave the node, arrive at the same leaf, and take the same uplinks to the
spine, the second rail doubles the host’s egress capacity and does nothing for
the fabric’s ability to carry it. Check where each rail’s port actually lands:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ibnetdiscover | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-A2&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;ibstat mlx5_0 | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;/Port GUID/{print $3}&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
iblinkinfo &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-iE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;node01&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The application is not bandwidth-bound.&lt;/strong&gt; A latency-bound code gains nothing
from a second rail and may lose a little to the extra selection logic. This is
the outcome nobody wants to hear and it is frequently the correct one. It is
also the argument for measuring with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_mbw_mr&lt;/code&gt; at your application’s real
message sizes rather than with a large-message &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; that flatters the
configuration.&lt;/p&gt;

&lt;h2 id=&quot;proving-rdma-is-engaged-not-tcp-over-ipoib&quot;&gt;Proving RDMA is engaged, not TCP over IPoIB&lt;/h2&gt;

&lt;p&gt;Silent fall back to TCP over IPoIB is the single most consequential quiet
failure in this area. Everything works. The job completes. The bandwidth is
roughly a tenth of what it should be and the latency is roughly ten times what
it should be, and both of those are within the range of “the code doesn’t scale
well,” which is what it gets recorded as.&lt;/p&gt;

&lt;p&gt;There are three ways to establish the truth, in increasing order of how
conclusive they are.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read the counters.&lt;/strong&gt; As above: if &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;port_xmit_data&lt;/code&gt; on the InfiniBand device
does not move during the run, the traffic is not on the InfiniBand transport.
Corroborate on the IPoIB side, where it will have gone instead:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/net/ib0/statistics/tx_bytes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Read the UCX transport selection.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_PROTO_INFO=y&lt;/code&gt; or
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_LOG_LEVEL=info&lt;/code&gt; will name the transport. Seeing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tcp&lt;/code&gt; where you expected
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rc_x&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dc_x&lt;/code&gt; is the finding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remove the fallback and see if it still runs.&lt;/strong&gt; This is the conclusive test,
and it takes one flag:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_TLS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;rc_x,sm,self ./osu_bw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That list contains no TCP transport. If the job runs, RDMA was working. If it
fails to establish connections, TCP was carrying the traffic and now you know.
Run this as a gate in your acceptance suite; it converts a silent degradation
into a loud failure, which is the whole objective.&lt;/p&gt;

&lt;p&gt;The usual root causes, once you have established fallback is happening:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Cause&lt;/th&gt;
      &lt;th&gt;Check&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Locked memory limit not raised&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ulimit -l&lt;/code&gt; inside the job, not on the login node&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Device down or not present on some nodes&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibstat&lt;/code&gt; across the whole allocation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UCX_NET_DEVICES&lt;/code&gt; naming a device that does not exist there&lt;/td&gt;
      &lt;td&gt;Node-by-node device enumeration&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Node with a different OFED or missing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rdma-core&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ofed_info -s&lt;/code&gt; fleet-wide&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Firewall or SELinux policy on a subset of nodes&lt;/td&gt;
      &lt;td&gt;Compare a working and a failing node&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ulimit -l&lt;/code&gt; deserves emphasis. Memory registration for RDMA requires locked
pages, and if the limit is not unlimited inside the job’s environment, UCX
cannot register buffers and falls back. The limit set in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/security/limits.d&lt;/code&gt;
applies to login sessions; what matters is the limit inside the scheduler’s
launched process, which can differ. Check it from inside a job:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;srun &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; 2 bash &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;echo $(hostname) $(ulimit -l)&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;rail-optimized-topologies&quot;&gt;Rail-optimized topologies&lt;/h2&gt;

&lt;p&gt;On AI clusters the multi-rail arrangement is often not “two rails to the same
fabric” but a rail-optimized design: each GPU has an adapter, and adapter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;k&lt;/code&gt; on
every node connects to switch &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;k&lt;/code&gt;. Same-index GPUs across nodes then communicate
within a single switch, which is what makes large all-reduces efficient.&lt;/p&gt;

&lt;p&gt;Two consequences for MPI. First, the affinity between rank, GPU and adapter is
not a tuning preference, it is the design, and getting it wrong sends traffic
across the fabric that was supposed to stay in one switch. Second, if the rails
are separate subnets, each has its own subnet manager and its own LID space, and
tooling that assumes one fabric will report on one of them and silently ignore
the rest.&lt;/p&gt;

&lt;p&gt;Verify the mapping is what the cabling intended before benchmarking anything:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvidia-smi topo &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;d &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; /sys/class/infiniband/mlx5_&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;basename&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;%s numa=%s lid=%s sm_lid=%s\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt;/device/numa_node&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;ibstat &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; 1 | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;/Base lid/{print $3}&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;ibstat &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; 1 | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;/SM lid/{print $3}&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;what-to-measure-and-in-what-order&quot;&gt;What to measure, and in what order&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw -d mlx5_0&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-d mlx5_1&lt;/code&gt; separately. Each rail alone should
reach the same number. If one is lower, stop — that is a link or slot problem
and it is not a multi-rail question.&lt;/li&gt;
  &lt;li&gt;Both rails simultaneously, as two concurrent &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; processes pinned to
the correct sockets. This is the host’s true aggregate ceiling and it is the
number multi-rail MPI is trying to reach.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; with one rail, then with both. Compare against step 2.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_mbw_mr&lt;/code&gt; at your application’s message sizes, one rail versus both, with
and without rail affinity.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 2 is the one that gets skipped, and it is the one that tells you whether the
shortfall is in the host or in MPI. If two concurrent &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; processes
cannot reach twice a single rail, no MPI configuration will, and you have a
PCIe, NUMA or memory-bandwidth investigation rather than a UCX one.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Fan-out tests: what one-to-many finds that point-to-point cannot</title>
    <link href="https://www.wirewalk.com/writing/mpi-fanout-collective-scaling/"/>
    <published>2026-09-05T14:00:00-04:00</published>
    <updated>2026-09-05T14:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/mpi-fanout-collective-scaling/</id>
    <summary>A single flow takes a single path, so a pair test is indifferent to almost everything that is wrong with a fabric. Fan-out puts many flows on it at once, and that is when static routing, ISL capacity and one slow node show up.</summary>
    <content type="html">&lt;p&gt;A point-to-point bandwidth test between two nodes exercises one path. Under
static routing — which is what InfiniBand does by default — that path is fixed
by the subnet manager’s forwarding tables, and one flow on one path is
indifferent to how well or badly those tables distribute traffic overall. You
can have a routing engine that has collapsed eight parallel inter-switch links
onto three, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; between a well-chosen pair will report a perfect
number, every time, reproducibly.&lt;/p&gt;

&lt;p&gt;Fan-out tests add the simultaneous flows missing from that pairwise result. They expose how the routing tables distribute a busy allocation across the available paths.&lt;/p&gt;

&lt;h2 id=&quot;the-three-shapes&quot;&gt;The three shapes&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;One-to-many.&lt;/strong&gt; One node sends to N others concurrently. This finds the sender’s
own ceiling — its adapter, its PCIe slot, its memory bandwidth — and it finds
the first hop out of that node’s leaf switch. It is the right test for a storage
node, a parameter server, or any rank-zero-heavy pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Many-to-one.&lt;/strong&gt; N nodes send to one. This is the incast pattern, and it is a
different test, not a mirror image. It is where switch buffering, flow control
and congestion control get exercised, and it is where a fabric that looks fine
under one-to-many falls apart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Many-to-many.&lt;/strong&gt; Every node to every node. This is what an alltoall does, and it
is the test that actually measures the fabric rather than any endpoint.&lt;/p&gt;

&lt;p&gt;Run all three. A cluster that passes one-to-many and fails many-to-many has a
fabric problem. A cluster that fails all three at the same node has a node
problem. That distinction is available in about twenty minutes and is otherwise
the subject of a long argument.&lt;/p&gt;

&lt;h2 id=&quot;osu_mbw_mr-and-why-message-rate-is-a-separate-ceiling&quot;&gt;osu_mbw_mr, and why message rate is a separate ceiling&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_mbw_mr&lt;/code&gt; is the multiple-bandwidth / message-rate test. It takes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2N&lt;/code&gt; ranks,
makes the first &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N&lt;/code&gt; senders and the second &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N&lt;/code&gt; receivers, pairs them up, and
runs all pairs concurrently. It reports aggregate bandwidth and aggregate
message rate for each message size.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# 16 ranks per node, one node sending, one node receiving&lt;/span&gt;
mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 32 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:16:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_NET_DEVICES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mlx5_0:1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ./osu_mbw_mr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two things make it worth running that a pair test is not.&lt;/p&gt;

&lt;p&gt;First, it is the only cheap way to find a &lt;strong&gt;per-node ceiling that is below the
per-link rate&lt;/strong&gt;. A single pair of ranks frequently cannot saturate a modern
adapter — one rank, one queue pair, one core is not enough to fill NDR400. If
you conclude from a single-pair &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; that the link is at half rate, you may
simply be measuring one core. Increase the concurrency and the number moves. If
it does not move, the ceiling is real and it is in the node.&lt;/p&gt;

&lt;p&gt;Second, the &lt;strong&gt;message rate&lt;/strong&gt; column is a ceiling that bandwidth never reveals.
Adapters have a maximum packets-per-second they can process, and applications
with many small messages hit that ceiling while the bandwidth graph looks
comfortable. If the message rate flattens as you add pairs while bandwidth is
nowhere near the link rate, the constraint is packet processing, not bytes, and
no amount of fabric work changes it. The fixes live elsewhere: message
aggregation, larger buffers, or a different communication pattern.&lt;/p&gt;

&lt;p&gt;Sweep the concurrency deliberately rather than accepting the default:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;ppn &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;1 2 4 8 16 32&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;== ppn=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ppn&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt;ppn&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ppn&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core ./osu_mbw_mr
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The shape of that sweep is the useful output. Bandwidth rises and plateaus;
where it plateaus is your real per-node number. Message rate rises and plateaus
somewhere else entirely.&lt;/p&gt;

&lt;h2 id=&quot;where-fan-out-exposes-the-fabric&quot;&gt;Where fan-out exposes the fabric&lt;/h2&gt;

&lt;p&gt;Here is the mechanism, because it is the part that is worth understanding rather
than memorizing.&lt;/p&gt;

&lt;p&gt;Under static routing, the subnet manager assigns each destination LID an output
port on every switch. Every flow to a given destination therefore leaves a given
switch through the same port, regardless of how busy that port is. On a
leaf-and-spine fabric with, say, eight uplinks from a leaf to the spine tier, the
routing engine distributes destination LIDs across those eight uplinks — and how
evenly it does that is the whole question.&lt;/p&gt;

&lt;p&gt;With one flow, you use one uplink and it is fine. With sixty-four concurrent
flows, if the distribution assigned twenty of them to one uplink and two to
another, that first uplink is oversubscribed by a factor of ten and the other is
idle. The aggregate number you measure is set by the busiest uplink, not by the
total capacity.&lt;/p&gt;

&lt;p&gt;This is not hypothetical and it is not rare. It is the normal consequence of a
routing engine that declined the topology and fell back to something simpler, of
a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updn&lt;/code&gt; configuration with no root GUID list, or of a fabric whose leaf uplink
counts are not uniform. The article on OpenSM routing engines in this series
covers how to confirm which engine is actually running.&lt;/p&gt;

&lt;h3 id=&quot;measuring-the-distribution-directly&quot;&gt;Measuring the distribution directly&lt;/h3&gt;

&lt;p&gt;Do not infer it from bandwidth. Read the switch counters.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# baseline&lt;/span&gt;
ibclearerrors
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;lid &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SPINE_LIDS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;perfquery &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$lid&lt;/span&gt;   &lt;span class=&quot;c&quot;&gt;# extended (64-bit) counters, all ports&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /var/tmp/counters-before.txt

mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 512 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:8:node ./osu_alltoall &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; 1048576:1048576

&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;lid &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SPINE_LIDS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;perfquery &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$lid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /var/tmp/counters-after.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitData&lt;/code&gt; is in 32-bit words on most implementations, so multiply by four
for bytes; what you care about is the ratio between uplinks, not the absolute
value. Take the delta per port and look at the spread. An engine distributing
well produces uplink deltas within a few percent of each other. An engine that
is not produces a spread you can see without a calculator, and that spread is
your missing bandwidth.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt; on the same ports is the corroborating evidence. It counts ticks
during which the port had data queued and no credit to transmit. Large and
uneven &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt; across parallel uplinks is congestion concentrated on a
subset of links, which is exactly the signature of a routing imbalance.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Use the 64-bit extended counters (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery -x&lt;/code&gt;, or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery -x -a&lt;/code&gt;). The
legacy 32-bit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitData&lt;/code&gt; counter wraps in seconds at modern link rates, and
a wrapped counter produces a delta that is not merely wrong but arbitrarily
wrong — sometimes negative, sometimes plausible. This has cost people real
conclusions.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;reading-the-knee&quot;&gt;Reading the knee&lt;/h2&gt;

&lt;p&gt;Fan-out results are curves, and the useful information is in where the curve
bends rather than in any single point.&lt;/p&gt;

&lt;p&gt;Run the same collective at a fixed message size across a doubling sequence of
node counts, holding ranks-per-node constant:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;n &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;2 4 8 16 32 64&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;srun &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--ntasks-per-node&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8 ./osu_allreduce &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; 4194304:4194304
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For &lt;strong&gt;allreduce&lt;/strong&gt;, the expected shape depends on the algorithm. NCCL-style and
MPI ring implementations move &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2(n-1)/n&lt;/code&gt; of the buffer per rank, which
approaches a constant as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;n&lt;/code&gt; grows, so time at a large fixed message size should
flatten out rather than grow. Tree and recursive-doubling implementations trade
that for a latency term that grows as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;log(n)&lt;/code&gt;, which dominates at small message
sizes. So: at large messages you expect a plateau, at small messages you expect
a gentle logarithmic rise. Anything that rises &lt;strong&gt;linearly&lt;/strong&gt; with node count is
not the algorithm — it is the fabric or a straggler.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;alltoall&lt;/strong&gt;, every rank sends to every other rank, so the total bytes
crossing the fabric grows as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;n²&lt;/code&gt; while the bisection capacity of a
non-blocking fat tree grows as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;n&lt;/code&gt;. On a genuinely non-blocking fabric, per-rank
alltoall time at a fixed per-peer message size should stay roughly flat. The
node count where it stops being flat is a measurement of where your fabric stops
being non-blocking, and that is a genuinely useful number to own.&lt;/p&gt;

&lt;p&gt;Three distinct knee shapes and what each means:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Shape&lt;/th&gt;
      &lt;th&gt;Reading&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Flat, then a step at a specific node count&lt;/td&gt;
      &lt;td&gt;You crossed a topology boundary — filled a leaf, started using spine uplinks, or crossed into a second island&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Flat, then a smooth linear rise&lt;/td&gt;
      &lt;td&gt;Oversubscription. The fabric’s aggregate capacity is now the limit&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Noisy from the start, no clean curve&lt;/td&gt;
      &lt;td&gt;Not a scaling result at all. Something is varying between runs — go find it before drawing any curve&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;That third row is the common one and it is worth taking seriously. If you cannot
reproduce a point to within a few percent across three runs, you do not yet have
a measurement, and fitting a curve through it produces a confident wrong
conclusion.&lt;/p&gt;

&lt;h2 id=&quot;controlling-for-allocation&quot;&gt;Controlling for allocation&lt;/h2&gt;

&lt;p&gt;A scaling curve is only comparable if the node set is comparable. Two runs at 32
nodes that land on different parts of the fabric are two different experiments.&lt;/p&gt;

&lt;p&gt;Pin the placement and record it:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;srun &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; 32 &lt;span class=&quot;nt&quot;&gt;--ntasks-per-node&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8 &lt;span class=&quot;nt&quot;&gt;--nodelist&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat &lt;/span&gt;nodes.32&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt; ./osu_alltoall
scontrol show hostnames &lt;span class=&quot;nv&quot;&gt;$SLURM_JOB_NODELIST&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; run-&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; +%s&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;.nodes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If your scheduler has topology awareness configured, use it — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--switches=1&lt;/code&gt;
asks Slurm for an allocation within a single switch, and the difference between
a within-leaf run and a cross-spine run at the same node count is itself a
measurement worth taking.&lt;/p&gt;

&lt;p&gt;And record the node list with every result. The single most common reason a
benchmark “regressed” is that it ran somewhere else.&lt;/p&gt;

&lt;h2 id=&quot;the-one-slow-node-problem&quot;&gt;The one-slow-node problem&lt;/h2&gt;

&lt;p&gt;A collective completes when its slowest participant completes. That makes
fan-out tests exquisitely sensitive to a single degraded node — which is
useful, and also dangerous, because the symptom presents as a fabric-wide
problem.&lt;/p&gt;

&lt;p&gt;The signature: results that vary run to run in a way that correlates with the
allocation rather than with anything you changed. Some 32-node runs are fine and
some are 30 percent down, and which is which tracks whether a particular node
was included.&lt;/p&gt;

&lt;p&gt;The bisection method finds it quickly. Split the node set in half, run both
halves, keep the slow half, repeat. Six rounds covers 64 nodes. It is crude and
it is faster than reasoning about it.&lt;/p&gt;

&lt;p&gt;The systematic alternative is a pairwize sweep — every node against a fixed
reference node, using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; rather than MPI so you are testing one layer
at a time:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;n &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;scontrol show hostnames &lt;span class=&quot;nv&quot;&gt;$SLURM_JOB_NODELIST&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;ssh &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ib_write_bw -d mlx5_0 -F -s 1048576 -D 5 --report_gbits &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;/1048576/ {print n, $4}&apos;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-k2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The bottom of that sorted list is your answer, and it is usually one node with a
narrow link, a downtrained slot, or a transceiver on its way out. It is worth
running this on a schedule rather than during an incident: a node that
degrades quietly poisons every synchronized job it touches, and the cost of
finding out late is measured in withdrawn results, not in wasted cycles.&lt;/p&gt;

&lt;h2 id=&quot;what-to-keep&quot;&gt;What to keep&lt;/h2&gt;

&lt;p&gt;Per fabric, keep: the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_mbw_mr&lt;/code&gt; bandwidth and message-rate plateaus with the
concurrency at which each was reached; the alltoall and allreduce curves across
your real node-count range with the node lists attached; and the per-uplink
counter deltas from one representative alltoall.&lt;/p&gt;

&lt;p&gt;Keep the per-uplink deltas with the curves. If an even routing distribution becomes lopsided months later, those older samples show what changed, even when hardware upgrades make the headline bandwidth figures harder to compare.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>A layered order for MPI testing, and what each layer eliminates</title>
    <link href="https://www.wirewalk.com/writing/mpi-layered-test-methodology/"/>
    <published>2026-09-05T09:00:00-04:00</published>
    <updated>2026-09-05T09:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/mpi-layered-test-methodology/</id>
    <summary>Every layer of an MPI stack has a ceiling set by the layer beneath it. Test from the top and you will spend a week tuning something that was never the constraint. Test from the bottom and most investigations end in an hour.</summary>
    <content type="html">&lt;p&gt;An MPI slowdown can originate in a link, the host, the communication libraries or the application. These components are often installed and maintained separately, which makes it easy for an investigation to jump between them without settling any one question.&lt;/p&gt;

&lt;p&gt;Work up from the hardware. Establish what each layer can deliver before checking the layer above it. A collective result becomes much easier to interpret once the links, verbs path and MPI point-to-point behavior have known baselines.&lt;/p&gt;

&lt;h2 id=&quot;the-layers&quot;&gt;The layers&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Layer&lt;/th&gt;
      &lt;th&gt;Tool&lt;/th&gt;
      &lt;th&gt;What a clean result eliminates&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;0. Inventory&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibv_devinfo&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ofed_info&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;flint&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lspci&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Version skew, downtrained slots, wrong adapter&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;1. Link&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibstat&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlxlink&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Width, rate, cabling, physical errors&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;2. Verbs&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_read_bw&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_send_lat&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;The entire MPI and UCX stack&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;3. MPI point-to-point&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_latency&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bibw&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_mbw_mr&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Transport selection, protocol thresholds, pinning&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;4. Collectives&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_allreduce&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_alltoall&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_barrier&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Routing distribution, jitter, one slow rank&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;5. Application&lt;/td&gt;
      &lt;td&gt;The application&lt;/td&gt;
      &lt;td&gt;Nothing — it is what you were asked about&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Nothing here is novel. The value is entirely in refusing to skip.&lt;/p&gt;

&lt;h2 id=&quot;layer-0-inventory-before-measurement&quot;&gt;Layer 0: inventory before measurement&lt;/h2&gt;

&lt;p&gt;Half the MPI investigations that get escalated are version skew, and skew is
free to check before anything is measured. You want, across every node in the
allocation: the same OFED or DOCA-OFED release, the same adapter firmware, the
same MPI build, and PCIe slots that trained to their rated speed and width.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pdsh &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; node[01-64] &lt;span class=&quot;s1&quot;&gt;&apos;ofed_info -s; ibv_devinfo -d mlx5_0 | grep -E &quot;fw_ver|board_id&quot;&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | dshbak &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;board_id&lt;/code&gt; is the PSID, and it identifies the adapter model and OEM variant.
Two adapters with the same marketing name and different PSIDs are different
parts, take different firmware images, and do not necessarily behave alike.&lt;/p&gt;

&lt;p&gt;Then the slot. This is the check people skip, and it is the one that most often
turns a two-week investigation into a two-minute one:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lspci &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/infiniband/mlx5_0/device/uevent | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;PCI_SLOT_NAME | &lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f2&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-vv&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;LnkCap:|LnkSta:&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;LnkCap:	Port #0, Speed 32GT/s, Width x16, ASPM not supported
LnkSta:	Speed 16GT/s, Width x8, TrErr- Train- SlotClk+ DLActive+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That adapter is capable of PCIe Gen5 x16 and is running at Gen4 x8. Nothing will
report an error. The link will come up at its full InfiniBand rate. The host bus
will cap you at roughly a quarter of what the card can do, and every measurement
above this layer will be consistent, reproducible and wrong.&lt;/p&gt;

&lt;p&gt;The arithmetic is worth internalizing because it recurs across generations. A
PCIe Gen3 x16 slot delivers usefully under 13 GB/s after encoding and protocol
overhead, which is approximately one HDR100 link. Put an HDR200 adapter in one
and you have bought an HDR100 adapter. Gen4 x16 is roughly the right size for
HDR200 or NDR200. NDR400 wants Gen5 x16. XDR at 800 Gb/s is 100 GB/s in each
direction, which is more than a Gen5 x16 slot can carry, so on XDR hardware the
slot generation is not a footnote — check it explicitly and check what the
platform actually populated, not what the chassis datasheet says is possible.&lt;/p&gt;

&lt;h2 id=&quot;layer-1-the-link&quot;&gt;Layer 1: the link&lt;/h2&gt;

&lt;p&gt;Two questions only: is every port at the width and rate you paid for, and is any
port accumulating errors.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ibstat mlx5_0 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Port 1:
	State:            Active
	Physical state:   LinkUp
	Rate:             200
	Base lid:         91
	LMC:              0
	SM lid:           1
	Link layer:       InfiniBand
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rate: 200&lt;/code&gt; here is the aggregate link rate in Gb/s. Note that for the same
link, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt; reports the &lt;strong&gt;per-lane&lt;/strong&gt; rate and the width separately, and
conflating the two is a genuine and expensive misread:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  91    1[  ] ==( 4X  53.125 Gbps Active/  LinkUp)==&amp;gt;  12   9[  ] &quot;leaf01&quot; ( )
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is four lanes at 53.125 Gb/s each — an HDR200 link, not a 53 Gb/s link. On
NDR the same field reads &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;106.25 Gbps&lt;/code&gt; and the link is NDR400. Someone reading
that column as the link rate concludes their NDR fabric is running at 100 Gb/s
and opens a support case.&lt;/p&gt;

&lt;p&gt;The scan that matters is not any single port but the whole allocation at once,
looking for anything that is not at full width:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;iblinkinfo &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-vE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;4X *(25\.78125|53\.125|106\.25|212\.5)&apos;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A port that negotiated &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1X&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2X&lt;/code&gt; is Active, passes traffic, answers ping, and
runs your job at a fraction of the speed. It will not appear in any error log.&lt;/p&gt;

&lt;p&gt;For physical link quality on modern adapters, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlxlink&lt;/code&gt; is more informative than
the counters:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mlxlink &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; mlx5_0 &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--show_fec&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--show_eye&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It reports the negotiated speed, the FEC mode, raw and effective BER, and the
transceiver’s vendor and part number. A link that is up but marginal shows as a
raw BER several orders of magnitude worse than its neighbours while the
effective BER stays clean, because FEC is absorbing it. That link works until
the day it is under load, and then it is a fabric-wide mystery.&lt;/p&gt;

&lt;p&gt;Finally, clear the counters, run something, and read them back. Counters that
have been accumulating since the last power cycle tell you nothing about today:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ibclearerrors
&lt;span class=&quot;c&quot;&gt;# ... run a representative workload ...&lt;/span&gt;
ibqueryerrors &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; PortXmitWait,PortRcvErrors,SymbolErrorCounter,LinkDownedCounter
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt; is not an error. It counts ticks where a port had data to send and
no credit to send it, which is congestion, and it belongs to layer four rather
than here. Note it and move on.&lt;/p&gt;

&lt;h2 id=&quot;layer-2-verbs-without-mpi-in-the-picture&quot;&gt;Layer 2: verbs, without MPI in the picture&lt;/h2&gt;

&lt;p&gt;This is the layer people skip, and skipping it is why so many fabric problems
get diagnosed as MPI problems. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perftest&lt;/code&gt; talks to the adapter directly. If
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; is slow, no MPI tuning parameter is going to help you, and you
have just eliminated UCX, PMIx, Open MPI, process binding and the application in
one command.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# server&lt;/span&gt;
ib_write_bw &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; mlx5_0 &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--report_gbits&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# client&lt;/span&gt;
ib_write_bw &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; mlx5_0 &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--report_gbits&lt;/span&gt; node02
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-F&lt;/code&gt; suppresses the CPU-frequency warning on machines with a scaling governor,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-a&lt;/code&gt; sweeps all message sizes, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-i 1&lt;/code&gt; selects the physical port. Add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-x &amp;lt;n&amp;gt;&lt;/code&gt; to
select a GID index when you are on RoCE rather than InfiniBand.&lt;/p&gt;

&lt;p&gt;Read the header before the numbers. It tells you the MTU that was negotiated,
the transport, and the connection type:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; Number of qps   : 1        Transport type : IB
 Connection type : RC       Using SRQ      : OFF
 Mtu             : 4096[B]
 Link type       : IB
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;An MTU of 1024 where you expected 4096 is a finding in itself, and on RoCE it
usually means the network MTU is not jumbo end to end.&lt;/p&gt;

&lt;p&gt;Three runs, in this order, on the same pair:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; — one-directional RDMA write. The cleanest bandwidth number the
hardware can produce.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_read_bw&lt;/code&gt; — RDMA read. Reads are round-trip and depend on how many
outstanding reads the adapter allows, so this is normally lower than write and
a good deal more sensitive to the fabric.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_send_lat -a&lt;/code&gt; — send/receive latency across sizes. Sub-microsecond at small
sizes on a single-hop modern fabric; each additional switch hop adds a
well-defined increment you can measure directly by comparing an intra-leaf pair
against a cross-spine pair.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What “good” is here is a property of your hardware, not something to assert from
an article. The check you can do without a reference number is arithmetic: take
the signalling rate from layer one, subtract the line encoding overhead, and see
whether &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; at large message sizes lands close to it. If it lands at
half, look at the width and the PCIe slot before looking anywhere else.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Run layer two between several different node pairs, chosen deliberately: two
nodes on the same leaf, two nodes on different leaves, and the two nodes
furthest apart in the topology. One pair tells you almost nothing. Three pairs
chosen by topology tell you whether the problem is a node, a link, or the core
of the fabric.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;layer-3-mpi-point-to-point&quot;&gt;Layer 3: MPI point-to-point&lt;/h2&gt;

&lt;p&gt;Now, and only now, introduce MPI. If layer two was clean and layer three is not,
the problem is in the MPI stack, and that is a much smaller search space than
“somewhere in the cluster.”&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:1:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_NET_DEVICES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mlx5_0:1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ./osu_latency
mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:1:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;UCX_NET_DEVICES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mlx5_0:1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ./osu_bw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Compare &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; against the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; number from the same pair. A gap of a
few percent is the MPI protocol overhead and is expected. A gap of a factor of
several means MPI is not using the transport you think it is, and the single
most common reason is a silent fall back to TCP over IPoIB.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bibw&lt;/code&gt; runs traffic in both directions at once and is the test that finds
half-duplex-like behavior and PCIe bottlenecks, because it is the first test
that asks the host bus for full bandwidth in both directions simultaneously. A
machine that does well on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; and poorly on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bibw&lt;/code&gt; is usually telling
you about its slot, not its fabric.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_mbw_mr&lt;/code&gt; is the one that belongs at the end of this layer. It runs multiple
concurrent pairs and reports both aggregate bandwidth and message rate. It is
the bridge into layer four, and it is where a per-node ceiling that no
single-pair test can see becomes visible.&lt;/p&gt;

&lt;p&gt;Pinning is not optional at this layer. An unpinned rank measures the scheduler.
Confirm the adapter’s NUMA affinity and place accordingly:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/infiniband/mlx5_0/device/numa_node
lstopo &lt;span class=&quot;nt&quot;&gt;--output-format&lt;/span&gt; txt
mpirun &lt;span class=&quot;nt&quot;&gt;--report-bindings&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 ...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--report-bindings&lt;/code&gt; prints where each rank actually landed. Read it. Do not
assume the binding you asked for is the binding you got, particularly under a
scheduler that has its own cgroup opinions.&lt;/p&gt;

&lt;h2 id=&quot;layer-4-collectives&quot;&gt;Layer 4: collectives&lt;/h2&gt;

&lt;p&gt;Collectives are where fabric problems that point-to-point cannot see finally
appear, because they are the first thing that puts many flows on the fabric at
once and the first thing that is gated by its slowest participant.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 512 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:8:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core ./osu_alltoall
mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 512 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:8:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core ./osu_allreduce
mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 512 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:8:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core ./osu_barrier
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A collective that degrades while layers one through three stayed clean is
telling you about routing distribution, congestion, or jitter — never about the
link. That distinction is the whole reason to have run the lower layers first.
Fan-out behavior and how to read the knee in the scaling curve is a large
enough topic that it has its own article in this series.&lt;/p&gt;

&lt;h2 id=&quot;layer-5-the-application&quot;&gt;Layer 5: the application&lt;/h2&gt;

&lt;p&gt;By the time you get here you know the ceiling at every layer beneath, which
means an application number can finally be interpreted. If the application is at
sixty percent of what layer four delivers, that is an application question:
message sizes, communication/computation overlap, decomposition. If it is at
five percent, something below is still wrong and the earlier layers were not
tested carefully enough.&lt;/p&gt;

&lt;h2 id=&quot;what-testing-out-of-order-actually-costs&quot;&gt;What testing out of order actually costs&lt;/h2&gt;

&lt;p&gt;The failure mode is not that you fail to find the problem. It is that you find a
problem, and it is real, and it is not the one that is hurting you.&lt;/p&gt;

&lt;p&gt;Start at the application, and its message sizes will look suboptimal, because
application message sizes usually are. You will spend a week on the
decomposition. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1X&lt;/code&gt; link stays there the whole time. Start at the
collectives, and you will conclude the routing engine is badly distributed,
which it may well be, and you will schedule a maintenance window to change it
while the downtrained PCIe slot continues to cap the node.&lt;/p&gt;

&lt;p&gt;Both of those are true findings. Neither is the constraint. The ordering exists
because the only way to know whether a finding is the constraint is to know the
ceiling underneath it.&lt;/p&gt;

&lt;h2 id=&quot;recording-it&quot;&gt;Recording it&lt;/h2&gt;

&lt;p&gt;The output of this exercise is not a diagnosis, it is a baseline. Write down,
in version control, for a named node pair and a named node set: the OFED and
firmware versions, the PCIe link status, the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_read_bw&lt;/code&gt;
plateaus, the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_latency&lt;/code&gt; small-message number, and the collective curves at
the job sizes you actually run.&lt;/p&gt;

&lt;p&gt;Collect that record while the machine is healthy. During the next incident, compare the same node pairs and node sets before changing libraries or fabric settings.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>NVMe firmware maintenance: track download, slot selection and active revision separately</title>
    <link href="https://www.wirewalk.com/writing/nvme-firmware-slots-activation-maintenance/"/>
    <published>2026-09-04T10:00:00-04:00</published>
    <updated>2026-09-04T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nvme-firmware-slots-activation-maintenance/</id>
    <summary>Plan NVMe firmware work around verified device identity, slot capabilities, activation requirements and workload recovery, with a rollback assessment before touching the device.</summary>
    <content type="html">&lt;p&gt;A firmware utility can report success while the controller continues running its previous revision. The image may have been transferred or committed for a later activation event. Until the active revision is read back through the intended lifecycle, the update’s operational state remains incomplete.&lt;/p&gt;

&lt;p&gt;Treat firmware maintenance as a sequence of explicit states. Identify the device, qualify the image, establish the impact boundary, transfer and commit through the supported procedure, activate as required, and verify the resulting storage service. Keep the evidence for each step rather than collapsing the sequence into one green status.&lt;/p&gt;

&lt;p&gt;This discussion uses the established &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvme-cli&lt;/code&gt; 2.11 command model. It does not provide a generic write command to run against an arbitrary drive. Slot capabilities, action support and required activation events depend on the device, firmware and platform.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-target-and-the-supported-image&quot;&gt;Verify the target and the supported image&lt;/h2&gt;

&lt;p&gt;Record controller and subsystem identity, model, serial number, active firmware and the namespaces served through it. Match the device to its physical slot or remote storage-service role where appropriate.&lt;/p&gt;

&lt;p&gt;Obtain the firmware through the supported vendor or OEM channel and check its model, revision and platform requirements. Similar product names do not establish that two images are interchangeable. Retain the artifact identity and the release notes with the maintenance record.&lt;/p&gt;

&lt;p&gt;Use the &lt;a href=&quot;/writing/nvme-controller-namespace-identity-management/&quot;&gt;controller and namespace inventory process&lt;/a&gt; to reconcile the target immediately before the change. A controller reset or subsystem activation can affect more than the one namespace whose mount point prompted the maintenance request.&lt;/p&gt;

&lt;h2 id=&quot;read-slot-capabilities-and-the-current-state&quot;&gt;Read slot capabilities and the current state&lt;/h2&gt;

&lt;p&gt;Read-only observations can include:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvme id-ctrl /dev/nvme0 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
nvme fw-log /dev/nvme0 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
nvme smart-log /dev/nvme0 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
nvme list-subsys &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The path is illustrative. Save output with identity and timestamps, using the installed tool’s supported fields. The &lt;a href=&quot;https://github.com/linux-nvme/nvme-cli/blob/v2.11/Documentation/nvme-fw-log.txt&quot;&gt;firmware-slot log reference&lt;/a&gt; describes the retrieval interface; interpret the returned capabilities using the controller and vendor documentation.&lt;/p&gt;

&lt;p&gt;Determine the available slots, any read-only slot restriction, the active slot and any reported pending activation. Do not assume that an apparently empty slot is a guaranteed fallback location, or that the previous image can be activated after the new one changes persistent internal state.&lt;/p&gt;

&lt;h2 id=&quot;define-the-maintenance-boundary-before-the-transfer&quot;&gt;Define the maintenance boundary before the transfer&lt;/h2&gt;

&lt;p&gt;List every consumer of the affected controller or subsystem. Include filesystems, volume layers, raw-block users, virtual machines and other attached hosts. Resolve whether the device hosts the operating system, local scratch or shared research data.&lt;/p&gt;

&lt;p&gt;For a cluster, stop new allocations through the normal maintenance process and reach an agreed boundary for existing work. Flush and close application outputs according to the application’s durability protocol. A job leaving the queue does not by itself establish that every external consumer has stopped using the resource.&lt;/p&gt;

&lt;p&gt;If another path will carry traffic, verify that it survives the specific activation event. Multiple paths through one shared controller or subsystem can fail together. A claim of non-disruptive activation must come from supported capabilities and a qualified service test, not merely the number of paths in an inventory.&lt;/p&gt;

&lt;h2 id=&quot;keep-the-update-states-in-the-record&quot;&gt;Keep the update states in the record&lt;/h2&gt;

&lt;p&gt;The pinned &lt;a href=&quot;https://github.com/linux-nvme/nvme-cli/blob/v2.11/Documentation/nvme-fw-commit.txt&quot;&gt;Firmware Commit manual&lt;/a&gt; distinguishes committing an image and selecting activation behavior. Interpret its result together with the vendor’s requirements.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;State&lt;/th&gt;
      &lt;th&gt;Evidence to retain&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Image qualified&lt;/td&gt;
      &lt;td&gt;Exact artifact, model match, release requirements and supported procedure&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Image transferred&lt;/td&gt;
      &lt;td&gt;Tool result associated with the verified target and artifact&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Commit accepted&lt;/td&gt;
      &lt;td&gt;Selected slot/action and returned status, including activation requirements&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Activation event completed&lt;/td&gt;
      &lt;td&gt;Supported reset or power lifecycle, timestamps and observed impact&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;New revision active&lt;/td&gt;
      &lt;td&gt;Identify Controller and firmware-slot readback after activation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Service admitted&lt;/td&gt;
      &lt;td&gt;Identity, namespaces, data checks and representative workload outcome&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A successful transfer does not establish the later states. Nor does a reset prove that the intended revision became active. Avoid building automation that marks the entire operation successful when only its first administrative command returned zero.&lt;/p&gt;

&lt;h2 id=&quot;use-the-required-activation-event-not-a-guessed-equivalent&quot;&gt;Use the required activation event, not a guessed equivalent&lt;/h2&gt;

&lt;p&gt;The device can require a particular controller or subsystem reset or another supported power lifecycle. An operating-system reboot, a controller reset and removing power are different events; do not treat them as interchangeable without the platform’s documentation.&lt;/p&gt;

&lt;p&gt;Use the supported management path and preserve out-of-band access when a boot device or management dependency is involved. Record whether the service is expected to disappear temporarily and how the host should rediscover it.&lt;/p&gt;

&lt;p&gt;Keep routine reset loops out of the procedure. If the new revision does not activate as expected, retain the status and investigate the unmet requirement. Repeating disruptive actions can erase useful timing evidence and repeatedly affect the same consumers.&lt;/p&gt;

&lt;h2 id=&quot;assess-rollback-before-relying-on-it&quot;&gt;Assess rollback before relying on it&lt;/h2&gt;

&lt;p&gt;Some devices and revisions restrict downgrades or require a vendor-specific recovery process. A previous firmware slot is useful evidence, but not proof that returning to it will restore all prior behavior.&lt;/p&gt;

&lt;p&gt;Document the supported rollback or replacement path, access requirements, expected data impact and decision owner. If recovery requires replacing a boot device or rebuilding a storage member, include that work in the maintenance plan rather than calling it an immediate rollback.&lt;/p&gt;

&lt;p&gt;Keep research-data recovery independent of firmware recovery. A successful downgrade cannot repair every application artifact that was incomplete when service stopped. Verify recoverable checkpoints or equivalent outputs before maintenance where the workload requires them.&lt;/p&gt;

&lt;h2 id=&quot;reconcile-the-whole-service-after-activation&quot;&gt;Reconcile the whole service after activation&lt;/h2&gt;

&lt;p&gt;Read back active revision and device identity. Confirm expected namespaces, block formats, attachments and host-visible storage layers. Recheck logs for new media, integrity, reset or transport symptoms.&lt;/p&gt;

&lt;p&gt;Use a bounded create/write/read/verify cycle in an authorized filesystem test location, then run the representative application path. For GPU pipelines, confirm that the expected storage interface and supported direct or fallback mode still work; a raw device inventory cannot establish that integration.&lt;/p&gt;

&lt;p&gt;Compare latency and completion behavior with the saved baseline under comparable load. Include reconnect behavior and ordinary cleanup, especially when multipath or remote storage participates in the service.&lt;/p&gt;

&lt;h2 id=&quot;roll-out-by-qualified-hardware-and-role&quot;&gt;Roll out by qualified hardware and role&lt;/h2&gt;

&lt;p&gt;Start with a canary that represents the target model, firmware branch and service role. A local scratch drive and a shared storage device can require different acceptance criteria even if their model strings match.&lt;/p&gt;

&lt;p&gt;Expand only after the defined evidence is clean. Track actual active revisions across the population so a partly activated rollout does not appear complete. Keep devices with unresolved status outside ordinary admission until their state is understood.&lt;/p&gt;

&lt;p&gt;For interpreting the before-and-after logs, see &lt;a href=&quot;/writing/nvme-health-error-log-endurance-analysis/&quot;&gt;NVMe health and error analysis&lt;/a&gt;. For the path behavior that can determine maintenance impact, see &lt;a href=&quot;/writing/nvme-multipath-ana-failure-validation/&quot;&gt;NVMe multipath validation&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Mounting GPFS from a separate client cluster, end to end</title>
    <link href="https://www.wirewalk.com/writing/gpfs-client-cluster-remote-mount/"/>
    <published>2026-09-04T10:00:00-04:00</published>
    <updated>2026-09-04T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/gpfs-client-cluster-remote-mount/</id>
    <summary>Keeping compute nodes in their own cluster and remote-mounting the filesystem is the right default for almost every site. The setup is four commands. The parts that bite are the ones that only show up under load, months later.</summary>
    <content type="html">&lt;p&gt;A GPFS filesystem does not have to be mounted by the cluster that owns it. The
owning cluster exports it, a separate client cluster mounts it, and the two are
administered independently. This is the multicluster or remote mount model, and for
most sites with distinct storage and compute hardware it should be the default.&lt;/p&gt;

&lt;p&gt;The setup sequence is short, but the mount and service behavior deserves care. In particular, remounting a bind used as a running job’s working directory can cause a delayed failure that appears to come from the application.&lt;/p&gt;

&lt;h2 id=&quot;why-separate-the-clusters-at-all&quot;&gt;Why separate the clusters at all&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Blast radius.&lt;/strong&gt; A client cluster can be restarted, upgraded, reinstalled or
broken without touching the storage cluster. Where compute and storage share a
cluster, every compute-side action is a storage-side risk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Version independence.&lt;/strong&gt; The two clusters run their own minimum release levels.
You can upgrade compute nodes without moving the storage cluster, which matters
because the storage cluster is the one you least want to touch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quorum separation.&lt;/strong&gt; Compute nodes come and go. Storage nodes must not. Sharing a
cluster means the quorum design has to tolerate the churn of the noisiest half.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Administrative boundary.&lt;/strong&gt; The storage team owns the storage cluster’s
configuration. A compute-side administrator adding a node cannot alter the storage
cluster’s quorum, licensing or tunables by accident.&lt;/p&gt;

&lt;p&gt;The cost is one more cluster to manage and an authentication relationship to
maintain. It is worth it.&lt;/p&gt;

&lt;h2 id=&quot;create-the-client-cluster&quot;&gt;Create the client cluster&lt;/h2&gt;

&lt;p&gt;Install the same GPFS packages, build the portability layer, then create a cluster
containing only the clients:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmcrcluster &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; clientnodes &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; /usr/bin/ssh &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; /usr/bin/scp &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; compute-cluster
mmchlicense client &lt;span class=&quot;nt&quot;&gt;--accept&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; all
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note the license designation. Nodes that only mount a filesystem take a &lt;strong&gt;client&lt;/strong&gt;
license; nodes that serve NSDs take a server license. Getting this wrong is a
compliance problem rather than a technical one, but it is easier to set correctly
than to correct in an audit.&lt;/p&gt;

&lt;p&gt;Give the client cluster its own quorum — three nodes, chosen for stability rather
than convenience. Login nodes and infrastructure nodes make better quorum members
than batch compute nodes that are rebooted between jobs.&lt;/p&gt;

&lt;h2 id=&quot;exchange-keys&quot;&gt;Exchange keys&lt;/h2&gt;

&lt;p&gt;Each cluster generates a key and receives the other’s public half.&lt;/p&gt;

&lt;p&gt;On the &lt;strong&gt;storage&lt;/strong&gt; cluster:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmauth genkey new
mmauth update &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; AUTHONLY
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On the &lt;strong&gt;client&lt;/strong&gt; cluster:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmauth genkey new
mmauth update &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; AUTHONLY
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then copy each cluster’s public key to the other. On the storage cluster, register
the client and grant access to the filesystem:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmauth add compute-cluster.example &lt;span class=&quot;nt&quot;&gt;-k&lt;/span&gt; /path/to/client_id_rsa.pub
mmauth grant compute-cluster.example &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; fs1 &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; rw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-a rw&lt;/code&gt; can be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ro&lt;/code&gt; for a read-only export, which is worth using where it fits —
an analysis cluster that only reads a curated dataset does not need write access to
it.&lt;/p&gt;

&lt;h2 id=&quot;define-the-remote-cluster-and-filesystem-on-the-client&quot;&gt;Define the remote cluster and filesystem on the client&lt;/h2&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmremotecluster add storage-cluster.example &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; storage01,storage02,storage03 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-k&lt;/span&gt; /path/to/storage_id_rsa.pub

mmremotefs add gpfs0 &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; fs1 &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; storage-cluster.example &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-T&lt;/span&gt; /gpfs/gpfs0 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; rw,atime,mtime &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-n&lt;/code&gt; list is the contact nodes: the storage-cluster nodes the client will
approach to find the filesystem. Give it several. A single contact node is a single
point of failure for &lt;strong&gt;mounting&lt;/strong&gt;, though not for I/O once mounted.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-A yes&lt;/code&gt; sets automount, so the filesystem mounts at daemon start.&lt;/p&gt;

&lt;h2 id=&quot;understand-the-local-name-and-the-remote-name--they-are-not-the-same-thing&quot;&gt;Understand the local name and the remote name — they are not the same thing&lt;/h2&gt;

&lt;p&gt;This is the detail that causes the most confusion later, and it is also the feature
that makes filesystem rebuilds survivable.&lt;/p&gt;

&lt;p&gt;In &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmremotefs add gpfs0 -f fs1&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpfs0&lt;/code&gt; is the &lt;strong&gt;local device name&lt;/strong&gt; on the client
cluster and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fs1&lt;/code&gt; is the &lt;strong&gt;remote name&lt;/strong&gt; on the storage cluster. They are
independent. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmremotefs show&lt;/code&gt; displays the mapping:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Local Name  Remote Name  Cluster name              Mount Point
gpfs0       fs1          storage-cluster.example   /gpfs/gpfs0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The practical consequence: &lt;strong&gt;the storage cluster can rebuild and rename its
filesystem without any client-side path changing.&lt;/strong&gt; Build the replacement
filesystem under a new name, migrate, then repoint the remote name. Clients keep
their local device name and their mount point, so module paths, job scripts,
provisioning references and automation all continue to resolve.&lt;/p&gt;

&lt;p&gt;The trap that comes with it: anything that consumes the filesystem &lt;em&gt;name&lt;/em&gt; rather
than the mount point sees the new name. GPFS callbacks receive &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%fsName&lt;/code&gt;, and a
callback guard written against the old name silently stops matching. Cron entries
that name the device — snapshot scripts are the usual example — keep pointing at a
device that no longer exists. Before any rename, grep your automation for the
device name; after it, verify the callbacks still fire.&lt;/p&gt;

&lt;h2 id=&quot;configure-the-client-network&quot;&gt;Configure the client network&lt;/h2&gt;

&lt;p&gt;Clients need &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsPorts&lt;/code&gt; set for their own adapters, and it is not inherited from
anywhere useful:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmchconfig &lt;span class=&quot;nv&quot;&gt;verbsPorts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;mlx5_0/1&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; clientnodes
mmchconfig &lt;span class=&quot;nv&quot;&gt;verbsRdmaSend&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then verify RDMA is actually carrying data, rather than assuming:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmdiag &lt;span class=&quot;nt&quot;&gt;--network&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;by (TCP|RDMA) connection&quot;&lt;/span&gt;
mmfsadm &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;verbs conn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A client silently falling back to TCP over IPoIB will work. It will be several
times slower than it should be, it will not log an error, and the problem will be
attributed to the storage cluster. Check this on new nodes as a matter of routine —
particularly on any node added with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmaddnode&lt;/code&gt;, which does not inherit per-node
overrides.&lt;/p&gt;

&lt;h2 id=&quot;size-the-client-pagepool-deliberately&quot;&gt;Size the client pagepool deliberately&lt;/h2&gt;

&lt;p&gt;The default is small — often 1 GiB — and on a compute node with hundreds of
gigabytes of RAM that is usually wrong in one direction or the other.&lt;/p&gt;

&lt;p&gt;Too small and you lose read caching and prefetch effectiveness on exactly the
workloads that benefit most. Too large and you have taken memory away from jobs;
on a node where the scheduler enforces memory limits, the pagepool is memory the
scheduler does not know it has already lost.&lt;/p&gt;

&lt;p&gt;A few GiB is a reasonable starting point for a general compute node. Match it to
what the node is for, set it per node class rather than globally, and remember it
&lt;strong&gt;only takes effect on daemon restart&lt;/strong&gt; — a configured value with no restart is a
value that is not running.&lt;/p&gt;

&lt;h2 id=&quot;bind-mounts-over-gpfs-the-hazard-that-kills-jobs-silently&quot;&gt;Bind mounts over GPFS: the hazard that kills jobs silently&lt;/h2&gt;

&lt;p&gt;Sites commonly bind-mount a directory inside GPFS onto a conventional path — a
scratch area onto &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/scratch&lt;/code&gt;, a shared application tree onto a module path, a home
directory cache onto &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home&lt;/code&gt;. It is convenient and it introduces a specific,
serious failure mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A process whose current working directory is under a bind mount does not follow
that mount when it is re-established.&lt;/strong&gt; Tear the bind down and put it back, and the
process’s CWD is now invalid. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;getwd()&lt;/code&gt; starts returning NULL.&lt;/p&gt;

&lt;p&gt;The consequences are not immediate and they do not point at the cause:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The job does &lt;strong&gt;not&lt;/strong&gt; die at the moment of the remount. It dies at its next call
that needs the working directory, which may be minutes later.&lt;/li&gt;
  &lt;li&gt;The error surfaces deep inside application code. In R, for instance, a library
that saves and restores the working directory around a compile step fails with
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Error in setwd(cur) : character argument expected&lt;/code&gt;, because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cur&lt;/code&gt; is NULL. The
message names the application’s function. It reads unmistakably like a user bug.&lt;/li&gt;
  &lt;li&gt;Slurm marks the job FAILED rather than requeuing it, because from the scheduler’s
point of view the job exited non-zero of its own accord.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A rolling restart of a bind-mount unit across a compute fleet, with jobs running,
kills every job that has a working directory under that path. In one measured case
a sequential loop across eighteen nodes produced a 100% mortality rate among the
jobs it touched — every job spanning its node’s restart failed, none survived —
while the naive correlation test (“did jobs fail within sixty seconds of the
restart?”) found almost nothing and would have exonerated the change entirely. The
correct test is whether the restart fell &lt;strong&gt;inside&lt;/strong&gt; each job’s start-to-end window.&lt;/p&gt;

&lt;p&gt;The rules that follow from this:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Drain the node before touching a bind mount.&lt;/strong&gt; Treat it exactly as you would a
reboot. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scontrol update NodeName=&amp;lt;n&amp;gt; State=DRAIN&lt;/code&gt;, wait for the node to empty,
make the change, verify with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;findmnt&lt;/code&gt;, resume.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Never loop across a fleet without a per-node gate.&lt;/strong&gt; Restarts spaced a few
seconds apart are the signature of a script with no check in it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A bind restart is in one respect worse than a reboot.&lt;/strong&gt; A reboot kills jobs
visibly and the scheduler requeues them. A bind restart corrupts the state of
surviving processes, which then fail later with an error that blames the user.&lt;/li&gt;
  &lt;li&gt;If a fleet-wide change genuinely cannot wait for an empty cluster, the honest
options are a maintenance reservation or announcing the job losses. A silent
rolling loop is neither.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;validate-the-client-side&quot;&gt;Validate the client side&lt;/h2&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmmount all &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt;
mmlsmount all &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;                       &lt;span class=&quot;c&quot;&gt;# who has it mounted&lt;/span&gt;
mmdf gpfs0                             &lt;span class=&quot;c&quot;&gt;# capacity as the client sees it&lt;/span&gt;
mmdiag &lt;span class=&quot;nt&quot;&gt;--network&lt;/span&gt;                       &lt;span class=&quot;c&quot;&gt;# RDMA in use, not TCP&lt;/span&gt;
findmnt &lt;span class=&quot;nt&quot;&gt;-no&lt;/span&gt; SOURCE /gpfs/gpfs0         &lt;span class=&quot;c&quot;&gt;# the mount, not the unit state&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then test as a user, not as root. Many sites export storage through NFS with
root-squash somewhere in the path, and a root test that succeeds proves less than a
user test that fails.&lt;/p&gt;

&lt;p&gt;Confirm on &lt;strong&gt;every&lt;/strong&gt; class of node, not a sample. Head and login nodes frequently
differ from compute nodes in ways nobody documented — a local directory shadowing a
shared mount, a different module tree, an export that was never extended to the
control plane. A configuration checked only on the head node is a configuration
checked on the one machine that is least representative of where jobs run.&lt;/p&gt;

&lt;h2 id=&quot;day-2-failures-worth-recognizing&quot;&gt;Day-2 failures worth recognizing&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A node that mounts but performs badly.&lt;/strong&gt; Check &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsPorts&lt;/code&gt; and RDMA state first;
silent TCP fallback is the most common cause and the least visible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A node that will not mount after rejoining.&lt;/strong&gt; Per-node configuration —
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsPorts&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pagepool&lt;/code&gt;, license designation — is not inherited by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmaddnode&lt;/code&gt;.
Compare a working node against the new one line by line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automount not mounting.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-A yes&lt;/code&gt; mounts at daemon start. If the daemon started
before the network was ready, the mount fails and does not retry on its own.
Ordering the GPFS unit after &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;network-online.target&lt;/code&gt; avoids it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Contact nodes all down.&lt;/strong&gt; Clients cannot mount if none of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-n&lt;/code&gt; contact nodes
answer, even when the rest of the storage cluster is healthy. Keep the list
current: a contact node that was decommissioned two years ago is a mount failure
waiting for a coincidence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stale mounts after a storage-side event.&lt;/strong&gt; If the storage cluster force-unmounts,
clients can be left with a mount point that exists but does not work. The GPFS mount
callback described in the companion ECE guide is the reliable repair; systemd will
not notice on its own.&lt;/p&gt;

&lt;h2 id=&quot;the-pattern-underneath-all-of-these&quot;&gt;The pattern underneath all of these&lt;/h2&gt;

&lt;p&gt;When a remote mount behaves differently from its configuration, inspect the running client. The examples above include successful commands and services reporting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;active&lt;/code&gt; whose actual mount or RDMA state was still wrong.&lt;/p&gt;

&lt;p&gt;The habit that prevents most of it is cheap: after any change, check the thing
itself rather than the thing that describes it. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;findmnt&lt;/code&gt; rather than
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemctl is-active&lt;/code&gt;. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmfsadm dump config&lt;/code&gt; rather than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmlsconfig&lt;/code&gt;. A job run as
a user rather than a command run as root. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmdiag --network&lt;/code&gt; rather than the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsPorts&lt;/code&gt; setting you just made.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>LID budgets: what happens to addressing when the endpoint count changes</title>
    <link href="https://www.wirewalk.com/writing/infiniband-lid-budget-lmc/"/>
    <published>2026-09-04T09:00:00-04:00</published>
    <updated>2026-09-04T09:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/infiniband-lid-budget-lmc/</id>
    <summary>Every endpoint you add consumes address space and forwarding table entries. Both are finite, both are countable in advance, and neither fails gracefully.</summary>
    <content type="html">&lt;p&gt;A Local Identifier is the address a subnet manager assigns to a port so switches
can forward to it. It is sixteen bits. The unicast range runs from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x0001&lt;/code&gt; to
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0xBFFF&lt;/code&gt;, which is a little over forty-eight thousand addresses, with the
remainder reserved for multicast.&lt;/p&gt;

&lt;p&gt;Forty-eight thousand sounds like plenty, and on most fabrics it is. The number
that actually constrains you is usually not the LID space but the forwarding
table capacity of the switches, and both move when the endpoint count changes.&lt;/p&gt;

&lt;h2 id=&quot;what-consumes-a-lid&quot;&gt;What consumes a LID&lt;/h2&gt;

&lt;p&gt;Each channel adapter port gets at least one. Each switch gets one for its
management port. So a first approximation is: adapter ports, plus switches.&lt;/p&gt;

&lt;p&gt;The multiplier is LMC.&lt;/p&gt;

&lt;h2 id=&quot;lmc-and-why-it-multiplies&quot;&gt;LMC, and why it multiplies&lt;/h2&gt;

&lt;p&gt;LID Mask Control assigns each adapter port a contiguous block of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2^LMC&lt;/code&gt;
addresses instead of a single one. The point is multipathing: with several LIDs
pointing at the same port, the routing engine can compute different paths to
each, and traffic between a pair of nodes can be spread across them.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;LMC 0    1 LID per port
LMC 1    2 LIDs per port
LMC 2    4 LIDs per port
LMC 3    8 LIDs per port
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Set it in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opensm.conf&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lmc 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The cost is linear in the multiplier and it applies to every port. Going from
LMC 0 to LMC 2 does not add a few addresses; it quadruples consumption across
the entire fabric, and it quadruples the number of entries every switch has to
hold to reach those ports.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Leave LMC at 0 unless you have established that you need multipathing and that
your routing engine will use it. Raising it is a fabric-wide cost paid to solve a
problem many fabrics do not have.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-constraint-that-actually-bites&quot;&gt;The constraint that actually bites&lt;/h2&gt;

&lt;p&gt;Switch forwarding tables are the real limit. A linear forwarding table holds one
entry per reachable LID, and its capacity is a property of the switch silicon,
not of your configuration. When the number of LIDs in the subnet exceeds what a
switch can hold, that switch cannot route to all of them.&lt;/p&gt;

&lt;p&gt;This is why the LID budget is not simply “am I under 48,000.” It is “is every
switch able to hold an entry for every LID in the subnet,” and the answer depends
on the smallest table in the fabric. A mixed-generation fabric is governed by its
oldest switch.&lt;/p&gt;

&lt;p&gt;Check the capacity your switches actually report rather than assuming from the
model number:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ibdiagnet &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /var/tmp/ibdiag
smpquery SI &amp;lt;lid&amp;gt;          &lt;span class=&quot;c&quot;&gt;# switch info, including linear FDB capacity&lt;/span&gt;
saquery SI
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;counting-before-you-change-anything&quot;&gt;Counting before you change anything&lt;/h2&gt;

&lt;p&gt;The arithmetic is straightforward and worth doing on paper.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;LIDs  =  (adapter ports × 2^LMC)  +  switches  +  headroom
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Headroom matters because fabrics grow between maintenance windows, and because
a fabric at ninety-nine percent of its forwarding capacity behaves fine until the
day someone plugs in one more node.&lt;/p&gt;

&lt;p&gt;Two changes push this number hard, and they often arrive together:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Splitting switch ports.&lt;/strong&gt; Splitting does not itself consume LIDs — switches
still take one each — but it exists to let you attach more endpoints, and those
endpoints do. A split that doubles attachable ports is a plan to double the
adapter port count.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding dual-port adapters, or turning on the second port.&lt;/strong&gt; Each active port is
an endpoint. A fleet where the second port was cabled but never brought up will
double its LID consumption the day someone brings it up, and that is rarely
recorded as a change to addressing.&lt;/p&gt;

&lt;p&gt;Multiply the two together and a fabric that was comfortable becomes a fabric that
is not, without anyone having made a decision about addressing.&lt;/p&gt;

&lt;h2 id=&quot;what-exhaustion-looks-like&quot;&gt;What exhaustion looks like&lt;/h2&gt;

&lt;p&gt;It does not announce itself as an addressing problem. The symptoms are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Nodes that enumerate in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibnetdiscover&lt;/code&gt; but are unreachable from some parts of
the fabric and reachable from others, because the switches that ran out are the
ones on those paths.&lt;/li&gt;
  &lt;li&gt;Subnet manager logs reporting failures to set forwarding table entries.&lt;/li&gt;
  &lt;li&gt;Errors during table distribution on a sweep, often on the largest switches
first.&lt;/li&gt;
  &lt;li&gt;Intermittent, position-dependent reachability that looks like a cabling fault
and survives recabling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tell is that it is topology-dependent rather than node-dependent. A broken
adapter fails from everywhere. An exhausted table fails from behind that switch.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-iE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;lid|forwarding|fdb|table&apos;&lt;/span&gt; /var/log/opensm.log | &lt;span class=&quot;nb&quot;&gt;tail&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-60&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;interaction-with-the-routing-engine&quot;&gt;Interaction with the routing engine&lt;/h2&gt;

&lt;p&gt;Routing engines use LMC differently, which matters when you are deciding whether
to raise it.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftree&lt;/code&gt; can make use of multiple LIDs per port to distribute traffic across
parallel paths in a fat tree, and on a fabric that qualifies it is the case where
raising LMC has a defensible payoff. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updn&lt;/code&gt; derives less benefit, because the
up/down constraint already limits which paths are legal. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minhop&lt;/code&gt; does the least
with it.&lt;/p&gt;

&lt;p&gt;So the sequence is: confirm which engine is genuinely running, then decide about
LMC. Raising LMC to enable multipathing under an engine that will not use it buys
you four times the forwarding table pressure and nothing else.&lt;/p&gt;

&lt;h2 id=&quot;practical-discipline&quot;&gt;Practical discipline&lt;/h2&gt;

&lt;p&gt;Record the LID count as a monitored number, not as something you look up during
an incident. It is cheap to collect and it turns a class of confusing failures
into a threshold you crossed.&lt;/p&gt;

&lt;p&gt;Recompute the budget as part of planning any change to endpoint count — new
nodes, split ports, second ports brought up, a new storage tier. The calculation
takes a few minutes and the alternative is discovering the limit during a
maintenance window with the change half applied.&lt;/p&gt;

&lt;p&gt;Include the chosen LMC value in that budget. Its address multiplier can consume forwarding-table capacity much faster than endpoint counts alone suggest.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Deploying a GPFS ECE cluster, end to end</title>
    <link href="https://www.wirewalk.com/writing/gpfs-ece-cluster-deployment/"/>
    <published>2026-09-04T09:00:00-04:00</published>
    <updated>2026-09-04T09:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/gpfs-ece-cluster-deployment/</id>
    <summary>Erasure Code Edition turns commodity servers with internal NVMe into a parallel filesystem with no external RAID. The install is well documented. The decisions that are expensive to reverse are not, and most of them are made in the first hour.</summary>
    <content type="html">&lt;p&gt;Erasure Code Edition (ECE) runs IBM Storage Scale’s declustered RAID in software,
across the internal drives of ordinary servers. There is no controller, no external
array, and no appliance. You get the ESS data protection model on hardware you
specify yourself.&lt;/p&gt;

&lt;p&gt;IBM documents the installation sequence. The decisions below deserve attention before installation: fault tolerance, hardware validation, network paths and capacity. Later sections cover cases where the configured values and running system disagree.&lt;/p&gt;

&lt;h2 id=&quot;decide-whether-ece-is-the-right-answer-at-all&quot;&gt;Decide whether ECE is the right answer at all&lt;/h2&gt;

&lt;p&gt;ECE earns its place when you want parallel-filesystem performance from servers you
control, and you have a fast private network to spend on it. It is the wrong answer
in three cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Too few nodes.&lt;/strong&gt; The documented minimum is four servers per recovery group. Four
is a number you can build, not a number you should run — see the fault tolerance
arithmetic below. Six is a sensible floor and eight or more is where the model
starts behaving the way the marketing describes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mixed hardware inside a recovery group.&lt;/strong&gt; Every server in a recovery group should
be the same model with the same drive count, drive model, CPU and memory. ECE
distributes strips on the assumption that servers are interchangeable. They do not
have to match across recovery groups, but within one they effectively do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No dedicated fast network.&lt;/strong&gt; ECE reads amplify. Delivering one byte to a client
moves roughly 1.875 bytes on the storage fabric with an 8+2p code, because
reconstructing a block gathers strips from every other server. If that traffic
shares a congested network with everything else, you have built an expensive way to
be slow.&lt;/p&gt;

&lt;h2 id=&quot;get-the-fault-tolerance-arithmetic-right-before-you-buy-anything&quot;&gt;Get the fault tolerance arithmetic right before you buy anything&lt;/h2&gt;

&lt;p&gt;This is the single decision most likely to be regretted, and it is made before a
single package is installed.&lt;/p&gt;

&lt;p&gt;Fault tolerance is not the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;p&lt;/code&gt; in the code name. A code writes a fixed number of
strips, and those strips land on distinct servers. If the strip count exceeds the
server count, some server necessarily holds two strips of the same stripe, and
losing that one server costs you two strips.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Code&lt;/th&gt;
      &lt;th&gt;Strips&lt;/th&gt;
      &lt;th&gt;Servers&lt;/th&gt;
      &lt;th&gt;Strips per server&lt;/th&gt;
      &lt;th&gt;Node fault tolerance&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;8+2p&lt;/td&gt;
      &lt;td&gt;10&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;some hold 2&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;8+2p&lt;/td&gt;
      &lt;td&gt;10&lt;/td&gt;
      &lt;td&gt;11+&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;2&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;4+2p&lt;/td&gt;
      &lt;td&gt;6&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;4+3p&lt;/td&gt;
      &lt;td&gt;7&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;3&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;An 8+2p array on eight servers gives you &lt;strong&gt;node fault tolerance of 1&lt;/strong&gt;. That is not
a theoretical concern:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;One server down and you are one failure from data loss.&lt;/li&gt;
  &lt;li&gt;More immediately, &lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmvdisk&lt;/code&gt; refuses to suspend a server&lt;/strong&gt; while any vdisk in
the recovery group sits at fault tolerance 1. Every maintenance action that needs
a server offline — firmware, kernel updates, a BIOS setting, a physical move — is
blocked. Not warned about: blocked.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cost of fault tolerance 2 is capacity. A 4+2p code writes six strips for four
of data, so usable capacity is raw divided by 1.5. An 8+2p code divides by 1.25.
On the same hardware, moving from 8+2p to 4+2p costs you a fifth of your usable
space and buys you the ability to service the cluster.&lt;/p&gt;

&lt;p&gt;Decide this deliberately. Converting later means building a second filesystem
alongside the first and copying everything across, which needs enough free capacity
to hold both.&lt;/p&gt;

&lt;h2 id=&quot;validate-the-hardware-before-you-install-anything&quot;&gt;Validate the hardware before you install anything&lt;/h2&gt;

&lt;p&gt;IBM publishes two readiness tools in the SpectrumScaleTools repository:
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ece_network_readiness&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ece_storage_readiness&lt;/code&gt;. Run both before installing.
They check the things that will otherwise be discovered as a performance mystery
three weeks later.&lt;/p&gt;

&lt;p&gt;The thresholds worth knowing, because you can check them yourself:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Measure&lt;/th&gt;
      &lt;th&gt;Threshold&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;ICMP latency between storage nodes, average&lt;/td&gt;
      &lt;td&gt;≤ 1 ms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ICMP latency, maximum&lt;/td&gt;
      &lt;td&gt;≤ 2 ms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ICMP standard deviation&lt;/td&gt;
      &lt;td&gt;≤ 0.333 ms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;NVMe random 128 KiB IOPS, per drive&lt;/td&gt;
      &lt;td&gt;&amp;gt; 15,000&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Single-client read throughput&lt;/td&gt;
      &lt;td&gt;&amp;gt; 2,000 MB/s&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A cluster that misses the latency numbers will work and will never perform. The
standard deviation matters more than the average — jitter on the storage network
shows up as unexplained tail latency in every job on the cluster.&lt;/p&gt;

&lt;h2 id=&quot;prepare-the-operating-system&quot;&gt;Prepare the operating system&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pin the kernel.&lt;/strong&gt; ECE builds a portability layer against the running kernel. An
unplanned kernel update on one node produces a node that will not start &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmfsd&lt;/code&gt;
until you rebuild. Exclude kernel packages from routine updates and treat kernel
changes as a scheduled activity with a rebuild step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name devices by path, not by enumeration.&lt;/strong&gt; NVMe controllers are probed
asynchronously. The device that is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/nvme4n1&lt;/code&gt; today may be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/nvme1n1&lt;/code&gt; after
a reboot, and the mapping is not stable across identical servers. Any configuration
that names &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/nvmeXnY&lt;/code&gt; — a disk setup definition, a script, a monitoring check —
is a latent failure that surfaces at the worst time, which is during a reboot you
performed for an unrelated reason.&lt;/p&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/disk/by-path/&lt;/code&gt; or the WWN. ECE itself identifies drives by their unique
identifier and is unbothered; it is the tooling around ECE that breaks.&lt;/p&gt;

&lt;p&gt;A related trap: with NVMe native multipath, block devices sit under a virtual
subsystem and have no PCI parent. Reading a PCI address from the block device
returns nothing. The address lives on the controller, at
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/sys/class/nvme/nvmeN/address&lt;/code&gt;. A validation script that reads the wrong path
returns empty and, if written carelessly, reports success.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AMD EPYC platforms need two specific fixes.&lt;/strong&gt; On family 23 and 25 processors,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmaddnode&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmstartup&lt;/code&gt; can hang for twenty to thirty minutes at 99% CPU inside
the GSKit cryptographic library. The fix is documented by IBM as APAR IJ47407 and
amounts to setting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ICC_SHIFT=3&lt;/code&gt; in the ICCSIG configuration. Bake it into the
image; discovering it per node is a slow way to build a cluster.&lt;/p&gt;

&lt;p&gt;Separately, some Genoa-based platforms panic on late microcode load. If you see
kernel panics on nodes that otherwise boot, add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dis_ucode_ldr&lt;/code&gt; to the kernel
parameters and load microcode from the firmware instead.&lt;/p&gt;

&lt;h2 id=&quot;create-the-cluster&quot;&gt;Create the cluster&lt;/h2&gt;

&lt;p&gt;Install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpfs.base&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpfs.gpl&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpfs.ece&lt;/code&gt; and the license packages, then build the
portability layer with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmbuildgpl&lt;/code&gt;. Do this on every node before creating the
cluster, not as part of it.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmcrcluster &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; nodefile &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; /usr/bin/ssh &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; /usr/bin/scp &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; ece-cluster
mmchlicense server &lt;span class=&quot;nt&quot;&gt;--accept&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; all
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Quorum design is worth a moment. Use an odd number — three for most clusters, five
for large ones. Quorum nodes should be spread across failure domains: racks, power
feeds, and switches. A three-node quorum with all three in one rack is a
single-rack outage away from a filesystem that will not mount.&lt;/p&gt;

&lt;p&gt;Designate manager nodes explicitly rather than letting every server carry the role.
On a storage cluster the servers are busy; giving the manager role to all of them
means a manager failover happens under exactly the conditions where you least want
extra work.&lt;/p&gt;

&lt;h2 id=&quot;configure-the-network-and-verify-it-is-actually-being-used&quot;&gt;Configure the network, and verify it is actually being used&lt;/h2&gt;

&lt;p&gt;This is where clusters silently underperform.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsPorts&lt;/code&gt; tells GPFS which RDMA devices to use. Set it, then confirm it took:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmlsconfig verbsPorts                 &lt;span class=&quot;c&quot;&gt;# what is stored&lt;/span&gt;
mmfsadm dump config | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; verbs   &lt;span class=&quot;c&quot;&gt;# what is running&lt;/span&gt;
mmdiag &lt;span class=&quot;nt&quot;&gt;--network&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;by (TCP|RDMA) connection&quot;&lt;/span&gt;
mmfsadm &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;verbs conn               &lt;span class=&quot;c&quot;&gt;# per-peer RDMA counters&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three failure modes, all of which present as “it works, but slowly”:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Per-node overrides are not inherited.&lt;/strong&gt; A node added later with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmaddnode&lt;/code&gt; does
not pick up a per-node &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsPorts&lt;/code&gt; setting. It falls back to the cluster default,
and if that default names a device the new node does not have, GPFS quietly uses
TCP over IPoIB instead. Throughput drops by a factor you will notice; nothing logs
an error. Check &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsPorts&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pagepool&lt;/code&gt; and the license designation after &lt;strong&gt;every&lt;/strong&gt;
node addition or rejoin.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pointing at the wrong port type.&lt;/strong&gt; A dual-port adapter may present one InfiniBand
port and one Ethernet/RoCE port. A global default of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlx5_1/1&lt;/code&gt; aims GPFS at
whichever port happens to be second, which on some platforms is the RoCE port.
Check &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;link_layer&lt;/code&gt; in sysfs before trusting a device name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The negotiated rate is not what you ordered.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt; reports the per-lane
rate, not the link rate. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4X 106.25 Gbps&lt;/code&gt; is NDR400; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4X 53.125 Gbps&lt;/code&gt; is HDR200;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2X 53.125 Gbps&lt;/code&gt; is a half-width HDR100 link that will gate every synchronized
operation across the cluster. The authoritative per-host view is
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/sys/class/infiniband/&amp;lt;dev&amp;gt;/ports/1/rate&lt;/code&gt;. Check every node, not a sample — one
degraded link is enough to make an entire benchmark meaningless, and it will be
blamed on the filesystem.&lt;/p&gt;

&lt;h2 id=&quot;build-the-recovery-group&quot;&gt;Build the recovery group&lt;/h2&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmvdisk nodeclass create &lt;span class=&quot;nt&quot;&gt;--node-class&lt;/span&gt; NC_ECE &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; storage01,storage02,...,storage08
mmvdisk server configure &lt;span class=&quot;nt&quot;&gt;--node-class&lt;/span&gt; NC_ECE &lt;span class=&quot;nt&quot;&gt;--recycle&lt;/span&gt; one
mmvdisk recoverygroup create &lt;span class=&quot;nt&quot;&gt;--recovery-group&lt;/span&gt; RG1 &lt;span class=&quot;nt&quot;&gt;--node-class&lt;/span&gt; NC_ECE
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmvdisk server configure&lt;/code&gt; sets the server-side parameters, including &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pagepool&lt;/code&gt;
and the RAID buffer pool percentage, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--recycle one&lt;/code&gt; restarts daemons one at a
time to apply them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Confirm the recycle actually completed.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pagepool&lt;/code&gt; takes effect only on daemon
restart. A configured value with no completed restart leaves the cluster running the
old value indefinitely, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmlsconfig&lt;/code&gt; will happily report the new one. The
running value is in the daemon’s own log at every start, and in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmdiag --config&lt;/code&gt;.
A cluster running months on a fraction of its intended pagepool is not a
hypothetical failure; the symptom is mediocre write performance that no tuning
fixes.&lt;/p&gt;

&lt;h2 id=&quot;define-vdisk-sets-and-read-the-size-units-carefully&quot;&gt;Define vdisk sets, and read the size units carefully&lt;/h2&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmvdisk vdiskset define &lt;span class=&quot;nt&quot;&gt;--vdisk-set&lt;/span&gt; VS1 &lt;span class=&quot;nt&quot;&gt;--recovery-group&lt;/span&gt; RG1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;--code&lt;/span&gt; 4+2p &lt;span class=&quot;nt&quot;&gt;--block-size&lt;/span&gt; 2M &lt;span class=&quot;nt&quot;&gt;--set-size&lt;/span&gt; 100T
mmvdisk vdiskset create &lt;span class=&quot;nt&quot;&gt;--vdisk-set&lt;/span&gt; VS1
mmvdisk filesystem create &lt;span class=&quot;nt&quot;&gt;--file-system&lt;/span&gt; fs1 &lt;span class=&quot;nt&quot;&gt;--vdisk-set&lt;/span&gt; VS1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--set-size&lt;/code&gt; is &lt;strong&gt;usable&lt;/strong&gt; capacity, not raw. Requesting 150 TiB at 4+2p consumes
225 TiB of raw space, and the command fails with “not enough space” on an array
that appears to have plenty. Multiply by the code’s expansion factor before you ask.&lt;/p&gt;

&lt;p&gt;Two more things that are difficult to change afterwards:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Block size changes the subblock count, not the subblock size.&lt;/strong&gt; Moving from 4 MiB
to 2 MiB blocks takes you from 512 subblocks to 256, both of 8 KiB. Small-file
efficiency is unchanged. If you are rebuilding a filesystem in the belief that a
smaller block size will help small files, check &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmlsfs -f&lt;/code&gt; first and confirm the
subblock size you expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmvdisk vdiskset list&lt;/code&gt; prints per-vdisk size, not set totals.&lt;/strong&gt; A set of sixteen
vdisks showing “81 TiB” is 1.27 PiB. Misreading that column is a straightforward way
to conclude a filesystem is nearly full when it is under ten percent used.
Allocation is not utilization: a declustered array can be 99% &lt;em&gt;allocated&lt;/em&gt; to vdisk
sets while the filesystem on top is nearly empty.&lt;/p&gt;

&lt;h2 id=&quot;tune-and-verify-each-change-actually-applied&quot;&gt;Tune, and verify each change actually applied&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmchconfig&lt;/code&gt; returning success means the value is stored. It does not mean the value
is in effect, and for several parameters it does not mean the value will ever be in
effect.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmlsconfig &amp;lt;param&amp;gt;                        &lt;span class=&quot;c&quot;&gt;# stored&lt;/span&gt;
mmfsadm dump config | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &amp;lt;param&amp;gt;     &lt;span class=&quot;c&quot;&gt;# running   &amp;lt;- the one that matters&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmfsadm dump config&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;!&lt;/code&gt; marks a value differing from default, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*&lt;/code&gt; marks
one changed at runtime. A value that appears with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;!&lt;/code&gt; but never with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*&lt;/code&gt; may have
been accepted and discarded.&lt;/p&gt;

&lt;p&gt;Parameters worth setting, with measured effect on an NVMe ECE cluster:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Parameter&lt;/th&gt;
      &lt;th&gt;Effect&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pagepool&lt;/code&gt; (servers)&lt;/td&gt;
      &lt;td&gt;Large. Shared-file writes improve substantially; file-per-process much less, because it was never buffer-starved&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;maxMBpS&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;~6% on writes, nothing on reads&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;workerThreads&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;prefetchThreads&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;~3% on writes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsdRAIDBufferPoolSizePct&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Sets the RAID buffer; leave at the configured default unless you have a reason&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Parameters that are accepted and do nothing on current versions. These are
documented here so nobody spends a rolling restart proving it again:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Parameter&lt;/th&gt;
      &lt;th&gt;Why it does nothing&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsRdmasPerNode&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Supported in 4.2.x only. Runtime value stays 0&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsRdmasPerConnection&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Obsolete since 5.0. Stored, discarded at runtime&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsdRAIDThreadsPerQueue&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;No measurable effect&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsNumSendChannel&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsNumRecvChannel&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;No measurable effect&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsRdmaMaxSendBytes&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;No measurable effect&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verbsRdmaSend&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Genuinely moves RPCs from TCP to RDMA — and changes throughput not at all. It governs daemon-to-daemon traffic, not the data path&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;make-the-cluster-repair-its-own-mounts&quot;&gt;Make the cluster repair its own mounts&lt;/h2&gt;

&lt;p&gt;Anything bind-mounted over a GPFS path — a scratch directory, a module tree, a
shared application area — is torn down when the filesystem goes away and is &lt;strong&gt;not&lt;/strong&gt;
re-established when it returns. A systemd unit with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BindsTo=gpfs.service&lt;/code&gt; covers a
service restart but not an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmshutdown&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmstartup&lt;/code&gt; cycle, because the filesystem
can disappear and return without the service unit changing state.&lt;/p&gt;

&lt;p&gt;GPFS knows when the filesystem mounts even when systemd does not. Register a
callback:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmaddcallback ScratchBind &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--command&lt;/span&gt; /usr/local/sbin/gpfs-post-mount.sh &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--event&lt;/span&gt; mount &lt;span class=&quot;nt&quot;&gt;--parms&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%fsName&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three details decide whether this works:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Match every device name the filesystem is known by.&lt;/strong&gt; If the filesystem is ever
renamed, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%fsName&lt;/code&gt; changes and a guard written against the old name exits
silently. Accept both, and log any name you do not recognize, so the next rename
leaves evidence instead of a silent outage.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Make the script idempotent and fast.&lt;/strong&gt; A slow callback delays the mount for
every node.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RemainAfterExit=yes&lt;/code&gt; is load-bearing&lt;/strong&gt; on any &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Type=oneshot&lt;/code&gt; bind unit.
Without it, systemd deactivates the unit the instant &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ExecStart&lt;/code&gt; returns and runs
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ExecStop&lt;/code&gt; as part of that normal deactivation — the unit binds the path and
unbinds it a second later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Be aware of the corollary: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemctl is-active&lt;/code&gt; on such a unit reports &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;active&lt;/code&gt;
whether or not the bind exists. Check the mount, with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;findmnt -no SOURCE &amp;lt;path&amp;gt;&lt;/code&gt;,
never the unit state.&lt;/p&gt;

&lt;h2 id=&quot;validate-with-numbers-that-survive-scrutiny&quot;&gt;Validate with numbers that survive scrutiny&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Size the dataset from the cache, not from convenience.&lt;/strong&gt; Client-side &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O_DIRECT&lt;/code&gt;
bypasses the client pagepool but not the servers’ RAID buffer pool. That buffer is:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pagepool × nsdRAIDBufferPoolSizePct × number_of_servers
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Eight servers with a 128 GiB pagepool at 80% is roughly 800 GiB of read cache. A
read benchmark smaller than that measures memory. The error is large — a test that
reports 155 GiB/s cached can be 82 GiB/s cold. Size reads at several times the
buffer and confirm by re-running at double: if the number drops, you were measuring
cache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not mistake under-driving for a ceiling.&lt;/strong&gt; Too few outstanding I/Os looks
exactly like a hard limit. Sweep concurrency; a genuinely saturated system is flat
across 64, 96, 128 and 192 jobs, while an under-driven one climbs. Sweep node count
too, since a per-node limit and an aggregate limit are different problems with
different fixes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the fabric before tuning the filesystem.&lt;/strong&gt; If clients and servers sit on
different switches, measure the inter-switch links under load before changing a
single GPFS parameter. Static InfiniBand routing pins each destination to one
output port, and it can collapse many links into a few in one direction while the
other direction spreads perfectly. The signature is a large read/write asymmetry
with nothing apparently saturated, and no amount of GPFS tuning touches it.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsdperf&lt;/code&gt; exercises the NSD protocol with no disk layer at all, which separates
network from storage in one test. If &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsdperf&lt;/code&gt; and your filesystem report similar
numbers, the bottleneck is at or below the network and no tunable will help.&lt;/p&gt;

&lt;h2 id=&quot;restart-the-cluster-without-an-outage&quot;&gt;Restart the cluster without an outage&lt;/h2&gt;

&lt;p&gt;Many parameters need a daemon restart, which on a storage cluster means restarting
servers underneath a live filesystem. Done with gates it is routine.&lt;/p&gt;

&lt;p&gt;Refuse to start unless all of these hold, and re-check them between every node:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;every server &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;active&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;recovery group needs service: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;no&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;all pdisks &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ok&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;no rebuild or rebalance running&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;fault tolerance still at its design value&lt;/strong&gt; — this is the safety budget&lt;/li&gt;
  &lt;li&gt;the filesystem still mounted on a client&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Order matters: non-quorum nodes first to prove the procedure, then quorum nodes one
at a time, and the recovery group master &lt;strong&gt;last&lt;/strong&gt; so you do not trigger a pointless
master failover at the start.&lt;/p&gt;

&lt;p&gt;Run it detached — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;setsid nohup ... &amp;amp;&lt;/code&gt;. An administrator’s dropped SSH session
should not be able to leave a storage node down with no orchestration.&lt;/p&gt;

&lt;h2 id=&quot;the-failures-worth-recognizing-on-sight&quot;&gt;The failures worth recognizing on sight&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;“Node appears to already belong to a cluster.”&lt;/strong&gt; Usually a stale &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmsdrserv&lt;/code&gt;
process on the node from a previous attempt. Kill it and retry; reinstalling the
node is not required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A node that answers SSH but has no &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var/mmfs&lt;/code&gt;.&lt;/strong&gt; It is sitting in a provisioning
installer environment with a read-only NFS root, not the installed OS. Probe for a
real local root before running anything against a node you have just rebooted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reading the filesystem mounts it.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmlsfs&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmrepquota&lt;/code&gt; trigger an internal
mount. Doing a record-keeping step immediately before an unmount gate makes that
gate fail, and the internal mounts are not visible as user processes — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fuser&lt;/code&gt; shows
only kernel threads. Record first, force-unmount second, gate third. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmchfs -T&lt;/code&gt;
requires zero mounts including internal ones, and a plain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmumount -a&lt;/code&gt; does not
guarantee that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fileset inode limits do not carry across.&lt;/strong&gt; A fileset created on a new filesystem
defaults to a little over 100,000 inodes regardless of what the source held. A
migration that copies millions of files into it dies partway with no obvious cause.
Set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--inode-limit&lt;/code&gt; at creation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snapshots cannot be migrated.&lt;/strong&gt; They live with the filesystem. If a rebuild is
planned and any rollback history matters, extract it first; the new filesystem
starts with none.&lt;/p&gt;

&lt;h2 id=&quot;what-to-watch-once-it-is-running&quot;&gt;What to watch once it is running&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmhealth&lt;/code&gt; covers the basics. Beyond it, the signals that catch real problems early:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;long waiters&lt;/strong&gt; — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmdiag --waiters&lt;/code&gt;; anything over 30 seconds repeatedly is a
stuck subsystem, not a busy one&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;server queue depth&lt;/strong&gt; — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmfsadm dump nsd | grep -E &quot;pending|active&quot;&lt;/code&gt;. Queues
reporting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pending 0&lt;/code&gt; under load mean the servers are starved and the bottleneck
is upstream. This one measurement short-circuits most performance investigations
and is worth taking first, not last&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;RDMA actually in use&lt;/strong&gt; — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmdiag --network&lt;/code&gt;, per the earlier warning&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;pdisk state and fault tolerance&lt;/strong&gt; — a background rebuild is normal; a fault
tolerance that has dropped and stayed down is not&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;config versus running state&lt;/strong&gt; — periodically diff &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmlsconfig&lt;/code&gt; against
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmfsadm dump config&lt;/code&gt;. Divergence is silent and accumulates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep the configuration-versus-runtime comparison in routine checks. It catches a change that was saved but never applied, without waiting for the next workload to expose it.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Changing the OpenSM routing engine: updn, ftree, and the silent fallback</title>
    <link href="https://www.wirewalk.com/writing/opensm-routing-engines/"/>
    <published>2026-09-04T08:00:00-04:00</published>
    <updated>2026-09-04T08:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/opensm-routing-engines/</id>
    <summary>Setting routing_engine does not mean the engine you named is the engine you got. ftree in particular declines the job and hands it back, and it does so in a log line most people never read.</summary>
    <content type="html">&lt;p&gt;The subnet manager decides which path every packet takes through the fabric, and
the routing engine is the algorithm it uses to decide. Changing it is a one-line
edit to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opensm.conf&lt;/code&gt;. Confirming that the change actually took is the part worth
learning, because one of the common engines refuses fabrics it does not like and
falls back to another without failing.&lt;/p&gt;

&lt;h2 id=&quot;the-engines-worth-knowing&quot;&gt;The engines worth knowing&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minhop&lt;/code&gt;&lt;/strong&gt; routes by shortest path. It is simple, fast to compute, and offers
no protection against credit loops. On a topology where cycles are possible, that
is a deadlock waiting for the right traffic pattern. It is a reasonable default
on small, regular fabrics and a poor one on anything irregular.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updn&lt;/code&gt;&lt;/strong&gt; applies an up/down turn rule: traffic may go up the tree and then
down, but never up again after descending. That constraint makes credit loops
impossible on an arbitrary topology, which is why up/down is the safe answer when
you do not know what shape the fabric is. The cost is path quality — some routes
are longer than they need to be, and the distribution across links is uneven.&lt;/p&gt;

&lt;p&gt;Up/down depends entirely on which nodes it treats as roots. Left to itself,
OpenSM guesses, and the guess is often poor on a fabric where spine and leaf
switches are not obviously distinguishable. Give it the answer explicitly:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;routing_engine updn
root_guid_file /etc/opensm/root_guids.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That file holds one spine switch GUID per line. Getting it right is the
difference between up/down performing acceptably and performing badly, and it is
the most common thing left undone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftree&lt;/code&gt;&lt;/strong&gt; is optimized for fat trees, and on a fabric that genuinely is one it
produces materially better link utilization than up/down. It also has strict
requirements about what counts as a fat tree: the topology must be regular,
constant bisectional bandwidth, with the compute nodes at the leaves and a
consistent number of links between tiers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dnup&lt;/code&gt;&lt;/strong&gt; inverts the up/down rule, and is occasionally the better fit where the
traffic pattern is dominated by leaf-to-leaf rather than leaf-to-core.&lt;/p&gt;

&lt;p&gt;There are others — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lash&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dor&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;torus-2QoS&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dfsssp&lt;/code&gt; — that matter on
specific topologies. If you are running a torus or a dragonfly, the engine is not
a matter of taste and the vendor guidance for that topology governs.&lt;/p&gt;

&lt;h2 id=&quot;the-silent-fallback&quot;&gt;The silent fallback&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;routing_engine&lt;/code&gt; accepts an ordered, comma-separated list, and that is not a
preference list in the way people assume. It is a fallback chain:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;routing_engine ftree,updn,minhop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;OpenSM tries &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftree&lt;/code&gt;. If the fabric does not satisfy its requirements, it logs
the reason and moves to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updn&lt;/code&gt;. The subnet comes up. Traffic flows. Nothing
appears to be wrong. You are simply not running the engine you configured, and
the performance you were expecting from the change does not arrive.&lt;/p&gt;

&lt;p&gt;This happens more often than it should, for mundane reasons: one node cabled to
a spine instead of a leaf, a leaf with a different uplink count from its
siblings, a switch that was down during the sweep, a section of the fabric added
later with a different ratio.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;After changing the engine, read the log and confirm which one is actually
running. Do not infer it from the configuration file. The configuration file
records what you asked for.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;confirming-what-is-running&quot;&gt;Confirming what is running&lt;/h2&gt;

&lt;p&gt;The subnet manager log is the primary source:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-iE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;routing engine|ftree|fallback|topology&apos;&lt;/span&gt; /var/log/opensm.log | &lt;span class=&quot;nb&quot;&gt;tail&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-40&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You are looking for a line naming the engine that was used, and — if &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftree&lt;/code&gt;
declined — a line explaining why. That explanation is usually specific enough to
fix: it will name the node or the tier that broke the assumption.&lt;/p&gt;

&lt;p&gt;For a fuller picture, have OpenSM write out what it computed:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;opensm &lt;span class=&quot;nt&quot;&gt;--dump_files_dir&lt;/span&gt; /var/tmp/osm-dump &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-o&lt;/code&gt; runs a single sweep and exits, which is what you want for inspection rather
than for taking over the subnet. The dump directory gets the LID matrices and
the per-switch forwarding tables, which is the ground truth about where traffic
will actually go.&lt;/p&gt;

&lt;p&gt;Then confirm from the fabric side:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sminfo
ibdiagnet &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /var/tmp/ibdiag &lt;span class=&quot;nt&quot;&gt;--routing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;applying-a-change&quot;&gt;Applying a change&lt;/h2&gt;

&lt;p&gt;Routing is recomputed on a sweep, and the engine is read at startup. A change
means restarting the subnet manager:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl restart opensm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two cautions. On a large fabric the recompute and redistribution of forwarding
tables is not instant, and traffic during that window can take paths that are in
the process of changing. Do this in a maintenance window on anything busy.&lt;/p&gt;

&lt;p&gt;And if you run a standby subnet manager, its configuration has to change too.
A failover onto a standby still holding the old engine will silently reroute the
entire fabric back, and the resulting “the fabric got slow again for no reason”
is genuinely hard to diagnose if you have forgotten the standby exists.&lt;/p&gt;

&lt;h2 id=&quot;measuring-whether-it-helped&quot;&gt;Measuring whether it helped&lt;/h2&gt;

&lt;p&gt;The point of changing engines is link utilization, so measure that rather than a
single pair’s bandwidth.&lt;/p&gt;

&lt;p&gt;Point-to-point between one pair of nodes is usually indifferent to the routing
engine, because a single flow takes a single path either way. What changes is
what happens when many flows share the fabric. Use an all-to-all or an all-reduce
across the real job size:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; &amp;lt;ranks&amp;gt; ./osu_alltoall
mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; &amp;lt;ranks&amp;gt; ./build/all_reduce_perf &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; 1G &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; 1G &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 20
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Take a baseline before the change, on the same node set, and compare. Also look
at per-port counters across the spine after a representative run: an engine that
is distributing well produces even traffic across parallel uplinks, and one that
is not produces a visible imbalance. That imbalance is often easier to see, and
more convincing, than a bandwidth number.&lt;/p&gt;

&lt;h2 id=&quot;adaptive-routing-is-a-different-layer&quot;&gt;Adaptive routing is a different layer&lt;/h2&gt;

&lt;p&gt;Modern switches can make per-packet forwarding decisions to route around
congestion. That is a switch feature, configured on the switch and in some cases
coordinated by the fabric manager, and it operates on top of whatever path set
the subnet manager computed. It is not a substitute for choosing the right
routing engine, and enabling it does not repair a fabric whose static routing is
badly distributed. Get the static routing right first, then decide whether
adaptive routing adds anything.&lt;/p&gt;

&lt;h2 id=&quot;the-short-version&quot;&gt;The short version&lt;/h2&gt;

&lt;p&gt;After an approved engine change and restart, read the log to confirm which engine is running. Give &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updn&lt;/code&gt; an explicit root list. Expect &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftree&lt;/code&gt; to decline if
anything about the topology is irregular, and treat its explanation as a cabling
bug report rather than a configuration problem. Measure with collectives, not
with a single pair.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Splitting ports on Quantum switches: what it costs you</title>
    <link href="https://www.wirewalk.com/writing/quantum-switch-port-splitting/"/>
    <published>2026-09-04T07:00:00-04:00</published>
    <updated>2026-09-04T07:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/quantum-switch-port-splitting/</id>
    <summary>Doubling your port count is the easy part. The parts that surprise people are the renumbering, the cabling, and what it does to the subnet manager.</summary>
    <content type="html">&lt;p&gt;Port splitting turns one high-rate port into two or four lower-rate ports. On a
Quantum-class HDR switch that is 40 ports at HDR200 becoming 80 at HDR100. On a
Quantum-2 NDR switch it is 64 logical NDR400 ports, presented through 32 physical
cages, becoming 128 at NDR200.&lt;/p&gt;

&lt;p&gt;The reason to do it is almost always economics. If your endpoints have HDR100 or
NDR200 adapters, an unsplit switch wastes half of every port’s capability, and
you buy twice the switches you need. The reason to think carefully first is that
splitting changes four things at once, and only the first is obvious.&lt;/p&gt;

&lt;h2 id=&quot;what-a-cage-actually-carries&quot;&gt;What a cage actually carries&lt;/h2&gt;

&lt;p&gt;The physical connector is not the port. On Quantum-2, one OSFP cage carries eight
lanes, presented by default as two NDR400 ports of four lanes each. Split, those
same eight lanes present as four NDR200 ports of two lanes each. Nothing about
the switch got faster or slower; the lanes were regrouped.&lt;/p&gt;

&lt;p&gt;This is why the aggregate switch bandwidth does not change when you split, and
why “we doubled the ports” and “we doubled the capacity” are different claims.
You have the same total, divided more finely.&lt;/p&gt;

&lt;h2 id=&quot;the-renumbering&quot;&gt;The renumbering&lt;/h2&gt;

&lt;p&gt;Split ports get a new naming scheme, and every piece of tooling that referenced
the old names breaks quietly.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;unsplit      1/1        1/2        1/3
split        1/1/1 1/1/2   1/2/1 1/2/2   1/3/1 1/3/2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Anything holding port identifiers is now wrong: monitoring definitions, cabling
records, port-to-node maps, error-counter baselines, and any script that walks a
port list. None of that fails loudly. It just reports on ports that no longer
exist, or misses ports that now do.&lt;/p&gt;

&lt;p&gt;Regenerate the topology from the fabric rather than editing your records by hand:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ibnetdiscover &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; topology-&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; +%F&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;.txt
iblinkinfo
ibdiagnet &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /var/tmp/ibdiag-&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; +%F&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Do that before the change as well as after. The diff is what you hand to whoever
maintains the monitoring.&lt;/p&gt;

&lt;h2 id=&quot;enabling-it&quot;&gt;Enabling it&lt;/h2&gt;

&lt;p&gt;The exact syntax depends on the switch OS release, and this is one of the places
where an old runbook will mislead you. The general shape on MLNX-OS is a system
profile that permits splitting, then a per-port module type, then a reboot:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;switch (config) # system profile ib split-ready
switch (config) # interface ib 1/1 module-type qsfp-split-2
switch (config) # write memory
switch (config) # reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three things to check against your own release notes rather than against this:
whether the profile change is required at all on your platform, whether the
split factor is expressed as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;split-2&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;split-4&lt;/code&gt;, and whether the reboot is
required or merely recommended. Treat the vendor documentation for your exact
firmware as authoritative.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The reboot is the real constraint.&lt;/strong&gt; Enabling split-ready mode is a switch
restart, which is a fabric event. On a single-switch fabric that is an outage. On
a leaf-and-spine fabric it is a capacity reduction and a routing re-convergence,
and if it is a spine, it is a large one. Plan it as maintenance, not as a
configuration change.&lt;/p&gt;

&lt;h2 id=&quot;cabling&quot;&gt;Cabling&lt;/h2&gt;

&lt;p&gt;A split port needs a splitter cable, and the breakout ratio has to match the
configured split factor. A two-way split needs a two-way breakout; a four-way
split needs a four-way. Mixing them produces ports that never link, with no error
message that says why.&lt;/p&gt;

&lt;p&gt;Two practical points. Splitter cables are physically bulkier at the switch end
and have real bend-radius limits, which matters in a dense cabinet more than the
datasheet suggests. And a partially split switch — some cages split, some not —
is entirely legal and genuinely useful, but it makes the cabling records the only
source of truth about which is which. Label at both ends.&lt;/p&gt;

&lt;h2 id=&quot;what-it-does-to-the-subnet&quot;&gt;What it does to the subnet&lt;/h2&gt;

&lt;p&gt;This is the part that gets underestimated.&lt;/p&gt;

&lt;p&gt;Splitting increases the number of endpoints the subnet manager has to
enumerate, assign and route. Every added endpoint consumes at least one LID,
occupies entries in the forwarding tables of every switch on any path to it, and
adds work to every sweep.&lt;/p&gt;

&lt;p&gt;Three consequences:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Routing table pressure.&lt;/strong&gt; Switch forwarding tables have a hard capacity.
Doubling endpoint count moves you toward that limit, and the failure mode when
you reach it is not graceful.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Longer sweeps.&lt;/strong&gt; More ports means more discovery and more table
distribution. On a large fabric the difference between a sweep that finishes
quickly and one that does not is operationally significant, because sweeps
happen on every topology change.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Changed oversubscription.&lt;/strong&gt; If you split leaf ports facing compute and leave
the spine uplinks alone, you have just changed the ratio between edge and core
capacity. That number should be a decision, not a side effect.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Work out the LID budget and the forwarding table headroom before you split, not
after. Both are countable in advance, and both are much cheaper to discover on
paper than during a maintenance window.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;verifying-it-took&quot;&gt;Verifying it took&lt;/h2&gt;

&lt;p&gt;After the reboot, confirm the switch presents what you expect, then confirm the
subnet manager agrees:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ibswitches
iblinkinfo | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; Active
ibdiagnet &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /var/tmp/ibdiag-after
sminfo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Compare the port count and the link rates against what you intended. A cage that
split but whose cable did not match will show ports in a down or polling state
rather than an error, so count active links rather than trusting the absence of
errors.&lt;/p&gt;

&lt;p&gt;Then check the error counters are clean from a fresh baseline, because the old
baseline referred to ports that no longer exist:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ibclearerrors
&lt;span class=&quot;c&quot;&gt;# run representative traffic&lt;/span&gt;
ibqueryerrors
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;when-not-to-split&quot;&gt;When not to split&lt;/h2&gt;

&lt;p&gt;If your endpoints have full-rate adapters, splitting throws away half of each
one’s capability for no gain. If you are already close to the forwarding table
limit, splitting is how you find the limit. And if the fabric is a single switch
with no maintenance window available, the reboot is the whole problem and no
amount of planning removes it.&lt;/p&gt;

&lt;p&gt;Use splitting when the endpoint count exceeds the available ports and the endpoints can use the reduced rate. Check those conditions, the forwarding budget and the required maintenance window before choosing a split profile.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>ConnectX firmware management: PSID, burn, reset, verify</title>
    <link href="https://www.wirewalk.com/writing/connectx-firmware-management-mft/"/>
    <published>2026-09-04T06:00:00-04:00</published>
    <updated>2026-09-04T06:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/connectx-firmware-management-mft/</id>
    <summary>Four commands do the work, and the one people skip is the one that makes the update real. The order matters, and the PSID matters more than the version number.</summary>
    <content type="html">&lt;p&gt;After a ConnectX update, compare the image in flash, stored device configuration and running firmware. They can disagree if activation is incomplete. A reported new image version is therefore a reason to check the reset and running state before troubleshooting its behavior.&lt;/p&gt;

&lt;h2 id=&quot;start-the-driver-find-the-device&quot;&gt;Start the driver, find the device&lt;/h2&gt;

&lt;p&gt;Nothing in the MFT toolset works until the MST kernel module is loaded and the
device nodes exist.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mst start
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mst status &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That prints paths under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/mst/&lt;/code&gt; of the form &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mt4123_pciconf0&lt;/code&gt; for a
ConnectX-6 or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mt4125_pciconf0&lt;/code&gt; for a ConnectX-7, alongside the PCI address, the
RDMA device name and the network interface. Everything downstream takes one of
those paths as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-d&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The MFT version matters here in a way that is easy to miss. A toolset older than
the silicon will either not enumerate the device or will enumerate it and then
refuse the image. If &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mst status&lt;/code&gt; shows nothing for a card you can see in
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lspci&lt;/code&gt;, update MFT before debugging anything else.&lt;/p&gt;

&lt;h2 id=&quot;query-before-touching-anything&quot;&gt;Query before touching anything&lt;/h2&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mlxfwmanager &lt;span class=&quot;nt&quot;&gt;--query&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three fields matter, and only one of them is the version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PSID&lt;/strong&gt; is the parameter set identifier, and it binds an image to a specific
hardware variant. Two cards with the same model number and the same firmware
version can carry different PSIDs, because one is an OEM part with different
defaults, a different port configuration or a different flash layout. Firmware
is published per PSID. This is the field to match on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FW version&lt;/strong&gt; appears in two forms: what is in flash, and what is running. When
those differ, an image has been burned and not activated. That is the state a
reset clears, and it is the most common reason a machine comes back from an
update behaving exactly as it did before.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Status&lt;/strong&gt; reports whether an update is available, which only means anything
when you are querying online.&lt;/p&gt;

&lt;p&gt;Where the host has outbound access:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mlxfwmanager &lt;span class=&quot;nt&quot;&gt;--online&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On an isolated fabric, which is the normal case, fetch the image matching the
PSID and burn it explicitly:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mlxfwmanager &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0 &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; fw-ConnectX7-rel.bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;the-psid-trap&quot;&gt;The PSID trap&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;flint&lt;/code&gt; will burn an image whose PSID does not match the card, if you insist:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;flint &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0 &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; image.bin burn                       &lt;span class=&quot;c&quot;&gt;# refuses&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;flint &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0 &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; image.bin &lt;span class=&quot;nt&quot;&gt;--allow_psid_change&lt;/span&gt; burn   &lt;span class=&quot;c&quot;&gt;# does not&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The refusal is a feature. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allow_psid_change&lt;/code&gt; exists for genuine cases —
recovering a card whose flash was corrupted, converting a part with vendor
approval — and it is not the flag to reach for because a burn failed. A card
running an image built for a different variant can come up with the wrong port
configuration, the wrong link type, or not come up at all, and the way back
involves the same tool in a much less comfortable mode.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Match on PSID, not on model. Two adapters that look identical in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lspci&lt;/code&gt; can
need different images, and any fleet bought in two tranches is likely to hold
both.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;device-configuration-is-separate-from-firmware&quot;&gt;Device configuration is separate from firmware&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlxconfig&lt;/code&gt; reads and writes non-volatile settings that survive firmware updates
and are not part of the image:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mlxconfig &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0 query
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mlxconfig &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0 &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;LINK_TYPE_P1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On a VPI-capable part, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LINK_TYPE_P1&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LINK_TYPE_P2&lt;/code&gt; decide whether a port
comes up as InfiniBand or Ethernet. Getting that wrong gives you a port that
never links and no error that explains why. Other settings worth knowing: SR-IOV
enablement and virtual function count, ATS, and the PCIe and performance knobs
that appear in vendor guidance from time to time.&lt;/p&gt;

&lt;p&gt;Two things to hold onto. A firmware update can introduce new configuration keys
carrying defaults you did not choose, so query after an update as well as
before. And &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlxconfig&lt;/code&gt; changes also need a reset to take effect, which brings
us to the step people skip.&lt;/p&gt;

&lt;h2 id=&quot;reset-and-when-a-reset-is-not-enough&quot;&gt;Reset, and when a reset is not enough&lt;/h2&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mlxfwreset &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0 query
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mlxfwreset &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0 &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; reset
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;query&lt;/code&gt; subcommand reports which reset levels the card and the platform will
actually support in the current state, which is more useful than it sounds: a
warm reset the platform cannot perform is reported rather than attempted.&lt;/p&gt;

&lt;p&gt;Some combinations of card, host and BIOS cannot do a live reset at all. In that
case the update is not applied until a full power cycle, and on some platforms
specifically an AC power cycle rather than a warm reboot. If you have burned an
image, run a reset, and the query still shows the old running version, stop
reasoning about firmware and go find out whether the machine actually
power-cycled.&lt;/p&gt;

&lt;h2 id=&quot;verify-against-running-state-from-three-directions&quot;&gt;Verify against running state, from three directions&lt;/h2&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mlxfwmanager &lt;span class=&quot;nt&quot;&gt;--query&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /dev/mst/mt4125_pciconf0 | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;PSID|FW&apos;&lt;/span&gt;
ethtool &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &amp;lt;netdev&amp;gt;
ibv_devinfo &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &amp;lt;rdma-dev&amp;gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; fw_ver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three sources because they read from different places. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mlxfwmanager&lt;/code&gt; reads
flash, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ethtool&lt;/code&gt; reports what the driver bound, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibv_devinfo&lt;/code&gt; reports what the
verbs layer sees. Agreement across all three is what “the update worked” means.
Disagreement between the first and the other two is the unreset-card signature.&lt;/p&gt;

&lt;h2 id=&quot;doing-this-across-a-fleet&quot;&gt;Doing this across a fleet&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Inventory by PSID, not by hostname.&lt;/strong&gt; Group the estate by PSID and firmware
version before planning anything. The distribution is reliably less uniform than
the purchase orders suggest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stagger by failure domain.&lt;/strong&gt; Adapters in the same rack, on the same leaf, or
serving the same storage class should not reset in the same window. A reset
drops the link and the subnet manager re-sweeps; doing that everywhere at once
turns a routine update into a fabric event.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Record before and after.&lt;/strong&gt; Query output for every card, stored and dated. The
value shows up months later, when something is behaving oddly and the only
question that matters is whether it changed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pair firmware with driver.&lt;/strong&gt; Vendor release notes pair firmware versions with
specific OFED or in-box driver versions. Updating one and not the other is
supported far less often than it is done, and the symptoms get blamed on the
application.&lt;/p&gt;

&lt;h2 id=&quot;what-this-does-not-cover&quot;&gt;What this does not cover&lt;/h2&gt;

&lt;p&gt;Switch firmware is a different toolchain and a different risk profile, and
deserves its own written procedure. So does recovery from an interrupted burn —
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;flint&lt;/code&gt; in its more surgical modes, and the cases where a card has to come up on
a recovery image. That one is worth writing down once, by whoever has just done
it, rather than improvised under pressure.&lt;/p&gt;

&lt;p&gt;Command syntax drifts between MFT releases. Check the installed release’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--help&lt;/code&gt; output and documentation for the commands above before using them; flags and supported reset behavior vary between versions.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>nccl-tests: bus bandwidth, and the one column worth reading</title>
    <link href="https://www.wirewalk.com/writing/nccl-tests-collective-bandwidth/"/>
    <published>2026-09-04T00:00:00-04:00</published>
    <updated>2026-09-04T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nccl-tests-collective-bandwidth/</id>
    <summary>Two of the columns nccl-tests prints look like bandwidth. Only one of them is comparable across job sizes, and picking the wrong one is how a healthy cluster gets declared broken.</summary>
    <content type="html">&lt;p&gt;Distributed training spends a large share of its wall clock inside collective
operations. In data-parallel training the dominant one is an all-reduce over the
gradients, once per step, sized by the model. If that collective is slower than
the hardware allows, every step is slower, and no amount of framework tuning
recovers it.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nccl-tests&lt;/code&gt; from NVIDIA is how you measure that path on its own, with no model
and no framework in the way.&lt;/p&gt;

&lt;h2 id=&quot;building-it&quot;&gt;Building it&lt;/h2&gt;

&lt;p&gt;Build against MPI if you intend to run across more than one node, which is the
only interesting case:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/NVIDIA/nccl-tests
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;nccl-tests
make &lt;span class=&quot;nv&quot;&gt;MPI&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 &lt;span class=&quot;nv&quot;&gt;MPI_HOME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/opt/openmpi &lt;span class=&quot;nv&quot;&gt;CUDA_HOME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local/cuda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That produces one binary per collective: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;all_reduce_perf&lt;/code&gt;,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;all_gather_perf&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reduce_scatter_perf&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;broadcast_perf&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;alltoall_perf&lt;/code&gt;,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sendrecv_perf&lt;/code&gt; and a few others. Start with all-reduce, because it is what
training actually does.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 16 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:8:node &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ./build/all_reduce_perf &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; 8 &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; 8G &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; 5 &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 20
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One rank per GPU, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-g 1&lt;/code&gt;. The sweep runs from 8 bytes to 8 GB doubling each
step, with five warmup iterations discarded and twenty timed. Warmup is not
optional: the first call pays for buffer registration and connection setup, and
including it drags the small-message numbers into nonsense.&lt;/p&gt;

&lt;h2 id=&quot;the-two-bandwidth-columns&quot;&gt;The two bandwidth columns&lt;/h2&gt;

&lt;p&gt;The output has, for both out-of-place and in-place variants, a time, an
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;algbw&lt;/code&gt;, a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;busbw&lt;/code&gt; and a correctness count.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;algbw&lt;/code&gt;&lt;/strong&gt; is algorithm bandwidth. It is simply the message size divided by the
elapsed time. It answers “how fast did my data get processed,” and it is the
number that looks intuitive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;busbw&lt;/code&gt;&lt;/strong&gt; is bus bandwidth. It is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;algbw&lt;/code&gt; scaled by a factor that accounts for
how much traffic the collective genuinely has to move across the interconnect,
given the number of ranks. For a ring all-reduce, each byte has to traverse the
ring twice, once in the reduce-scatter phase and once in the all-gather phase,
and each rank ends up sending &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(n-1)/n&lt;/code&gt; of the buffer in each phase:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;all-reduce         busbw = algbw × 2(n-1)/n
all-gather         busbw = algbw × (n-1)/n
reduce-scatter     busbw = algbw × (n-1)/n
all-to-all         busbw = algbw × (n-1)/n
broadcast, reduce  busbw = algbw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The consequence is the reason &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;busbw&lt;/code&gt; exists. As you add ranks, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;algbw&lt;/code&gt; for a
fixed message size falls, because there is more work to do per byte. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;busbw&lt;/code&gt;
stays roughly flat, because it is measuring what the wire is doing. That makes
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;busbw&lt;/code&gt; comparable against your hardware’s per-link capability and comparable
between a two-node run and a hundred-node run.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Track &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;busbw&lt;/code&gt;. Someone reporting that all-reduce “got slower when we scaled up”
is almost always reading &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;algbw&lt;/code&gt;, where a decline is arithmetic rather than a
fault. Compare &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;busbw&lt;/code&gt; at the same message size across job sizes; if that holds,
the fabric is behaving.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;reading-the-sweep&quot;&gt;Reading the sweep&lt;/h2&gt;

&lt;p&gt;The curve has two regimes and the transition tells you where your model sits.&lt;/p&gt;

&lt;p&gt;At &lt;strong&gt;small sizes&lt;/strong&gt; the result is latency-bound. Time is nearly flat as size
increases, so bandwidth rises roughly linearly. What you are measuring is the
fixed cost of a collective: kernel launch, synchronization, and the depth of the
communication pattern. NCCL uses tree algorithms here specifically because tree
latency grows logarithmically with rank count while ring latency grows linearly.&lt;/p&gt;

&lt;p&gt;At &lt;strong&gt;large sizes&lt;/strong&gt; the result is bandwidth-bound and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;busbw&lt;/code&gt; flattens into a
plateau. That plateau is the number to record and to compare against what the
links should deliver.&lt;/p&gt;

&lt;p&gt;Work out where your gradient all-reduce lands. For a bucketed data-parallel
setup, the bucket size is the message size, and it is frequently in the region
where neither regime dominates cleanly. Moving the bucket size is a real tuning
knob, and this sweep tells you which direction to move it.&lt;/p&gt;

&lt;h2 id=&quot;when-the-plateau-is-too-low&quot;&gt;When the plateau is too low&lt;/h2&gt;

&lt;p&gt;The plateau being well below what the hardware should do almost always comes
down to one of a short list.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NCCL chose the wrong interface.&lt;/strong&gt; On a node with a management NIC and several
fabric adapters, NCCL can select the wrong one. Verify rather than assume:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;NCCL_DEBUG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;INFO &lt;span class=&quot;nv&quot;&gt;NCCL_DEBUG_SUBSYS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;INIT,NET,GRAPH &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 16 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:8:node ./build/all_reduce_perf &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; 1G &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; 1G &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 20
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The output names each adapter it selected and prints the rings it constructed.
If it is using a socket transport where you expected InfiniBand, that is your
answer. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NCCL_IB_HCA&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NCCL_SOCKET_IFNAME&lt;/code&gt; constrain the choice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GPUDirect RDMA is not engaged.&lt;/strong&gt; Without it, every message stages through a
host bounce buffer. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;INIT&lt;/code&gt; log says whether GDR is in use per device.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NCCL_NET_GDR_LEVEL&lt;/code&gt; controls how aggressively it is applied relative to PCIe
topology distance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PCIe ACS is enabled.&lt;/strong&gt; Access Control Services forces peer-to-peer transfers
up through the root complex instead of across the switch, which quietly destroys
intra-node bandwidth. It is a BIOS or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;setpci&lt;/code&gt; change, and it is worth checking
on every new node type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The topology is not what you think.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NCCL_TOPO_DUMP_FILE&lt;/code&gt; writes out the
topology NCCL detected. Compare it against &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-smi topo -m&lt;/code&gt; and against how
the machine is actually cabled. Ring construction is only as good as the
topology discovery underneath it.&lt;/p&gt;

&lt;h2 id=&quot;correctness-is-a-column-too&quot;&gt;Correctness is a column too&lt;/h2&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#wrong&lt;/code&gt; column exists for a reason. Run with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-c 1&lt;/code&gt; at least occasionally.
A collective that returns wrong values under load is a hardware or driver fault,
and it is a much more serious finding than a disappointing bandwidth plateau. It
is also the kind of thing that shows up in a training run as a loss curve that
diverges for no apparent reason, days later, after a great deal of compute has
been spent.&lt;/p&gt;

&lt;h2 id=&quot;what-to-do-with-the-result&quot;&gt;What to do with the result&lt;/h2&gt;

&lt;p&gt;Record the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;busbw&lt;/code&gt; plateau, the message size where the curve leaves the
latency-bound regime, the rank count, and the driver, NCCL and firmware
versions. Re-run it after every driver update and every firmware change.&lt;/p&gt;

&lt;p&gt;A collective slowdown may first appear as a small increase in training step time, with no error in the logs. Comparing the saved curves after a driver or firmware change can reveal it before it affects many long runs.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>IOR and mdtest: why your storage benchmark says the filesystem is fine</title>
    <link href="https://www.wirewalk.com/writing/ior-mdtest-parallel-storage/"/>
    <published>2026-09-03T00:00:00-04:00</published>
    <updated>2026-09-03T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/ior-mdtest-parallel-storage/</id>
    <summary>Streaming bandwidth is the easiest number to produce and the least likely to describe an AI training workload. The metadata rate usually matters more, and almost nobody measures it.</summary>
    <content type="html">&lt;p&gt;IOR and mdtest answer different questions about a parallel filesystem. IOR moves blocks to measure bandwidth; mdtest creates, stats and removes files to measure metadata operations. They build from the same repository, so it is straightforward to keep both in a storage test suite.&lt;/p&gt;

&lt;p&gt;For a training workload with millions of small files, a good IOR result leaves much of the access path untested. Include metadata measurements and the application’s actual file sizes and concurrency.&lt;/p&gt;

&lt;h2 id=&quot;defeating-the-cache-which-is-most-of-the-work&quot;&gt;Defeating the cache, which is most of the work&lt;/h2&gt;

&lt;p&gt;The single most important thing about IOR is that a naive invocation measures
page cache. The client caches the write, reports success, and IOR reports a
bandwidth figure that reflects memory speed rather than storage.&lt;/p&gt;

&lt;p&gt;Three flags matter:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 128 ./ior &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; POSIX &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; 16g &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; 4m &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; 3 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /gpfs/scratch/iortest/file
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-e&lt;/code&gt; calls &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fsync&lt;/code&gt; before the write phase timer stops, so the write is on
stable storage rather than in the client’s cache.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-C&lt;/code&gt; reorders tasks between the write and read phases, so no rank reads back
the file it just wrote and finds it sitting in local page cache.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-b&lt;/code&gt; sets the block size per task. Make the aggregate substantially larger than
the total client memory, or the read phase is served from RAM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without those, your read bandwidth will look wonderful and mean nothing. If a
result looks impossibly good, this is the reason, every time.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-F&lt;/code&gt; selects file-per-process. The alternative, a single shared file, tests a
different thing: lock contention and the filesystem’s ability to handle
concurrent writers to one inode. Both are worth measuring, because applications
do both, and on some filesystems they perform very differently.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-t&lt;/code&gt; is the transfer size, the size of each individual read or write call.
Sweeping it is how you find where the client stops being able to fill the pipe.&lt;/p&gt;

&lt;h2 id=&quot;the-metadata-problem&quot;&gt;The metadata problem&lt;/h2&gt;

&lt;p&gt;Now the part that usually explains the complaint you were called about.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 128 ./mdtest &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 10000 &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-z&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; 8 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; 3 &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /gpfs/scratch/mdtest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;mdtest reports operations per second for file creation, stat, read, and removal,
plus the directory equivalents. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-u&lt;/code&gt; gives each task its own working directory,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-z&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-b&lt;/code&gt; control the depth and branching of the directory tree, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-n&lt;/code&gt; is
files per task.&lt;/p&gt;

&lt;p&gt;Run it with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-u&lt;/code&gt; and without. The difference is often dramatic, and it is one of
the more actionable results you can produce, because it tells you directly
whether the application’s directory layout is the problem. A single directory
holding a very large number of entries serializes on the metadata path in a way
that the same files spread across a tree do not.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;For AI training, metadata rate and small-file read latency usually predict
throughput far better than streaming bandwidth. A dataset of millions of small
files spends its time in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;open&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;stat&lt;/code&gt;, not in moving bytes. If you measure
one thing, measure that.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;interpreting-the-gap-between-the-two&quot;&gt;Interpreting the gap between the two&lt;/h2&gt;

&lt;p&gt;The relationship between the IOR and mdtest results is more informative than
either alone.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;High bandwidth, high metadata rate.&lt;/strong&gt; The filesystem is healthy. If an
application is still slow, the problem is in the application’s access pattern
or in the client, not the storage.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;High bandwidth, poor metadata rate.&lt;/strong&gt; Classic parallel filesystem shape.
The data path is fine and the metadata path is the bottleneck. Look at
metadata server placement, whether metadata sits on the same media as data,
and how the workload lays out directories.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Poor bandwidth, high metadata rate.&lt;/strong&gt; Usually the network or client
configuration rather than the filesystem: check RDMA is engaged, check the
mount options, check that clients are not falling back to a slower transport.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Both poor.&lt;/strong&gt; Look at the client before the server. A single-client run that
is also slow points at the node; a slow aggregate with fast single-client
results points at the server or the fabric between.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;running-it-so-the-numbers-survive-scrutiny&quot;&gt;Running it so the numbers survive scrutiny&lt;/h2&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-i&lt;/code&gt; to repeat and report the spread, not a single lucky run. Record the
client count, the ranks per client, the transfer and block sizes, the filesystem
version and the mount options alongside the result. Run against a directory with
the same striping or placement policy the real workload will use, because a
default-policy test directory can behave nothing like a production dataset.&lt;/p&gt;

&lt;p&gt;Repeat the same configuration on a suitable schedule and retain the results. When someone reports that storage has become slower, compare equivalent runs before changing the system.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Six shell idioms that quietly corrupt a data pipeline</title>
    <link href="https://www.wirewalk.com/writing/shell-idioms-that-corrupt-a-data-pipeline/"/>
    <published>2026-09-02T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/shell-idioms-that-corrupt-a-data-pipeline/</id>
    <summary>Each of these is valid shell that runs without error and produces a wrong answer: an empty field separator that looks like a tab, a grep that prints zero and fails, and an environment change discarded by a pipe.</summary>
    <content type="html">&lt;p&gt;The shell bugs that cost real time are not syntax errors. They are constructs that parse, run,
exit zero, and return something subtly wrong — so the failure surfaces three steps downstream as
bad data rather than as an error.&lt;/p&gt;

&lt;p&gt;The six cases below show where a valid shell command can quietly corrupt the next stage’s input.&lt;/p&gt;

&lt;h2 id=&quot;1-ifsprintf-t-is-an-empty-ifs&quot;&gt;1. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IFS=$(printf &apos;\t&apos;)&lt;/code&gt; is an empty IFS&lt;/h2&gt;

&lt;p&gt;The intent is to split a TSV on tabs. The result splits on nothing.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;IFS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;\t&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;      &lt;span class=&quot;c&quot;&gt;# IFS is now the EMPTY STRING&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; key value&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; ...&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; &amp;lt; data.tsv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Command substitution strips &lt;strong&gt;trailing whitespace&lt;/strong&gt;, and a tab is whitespace. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$(printf &apos;\t&apos;)&lt;/code&gt;
is therefore &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot;&quot;&lt;/code&gt;. With an empty &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IFS&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;read&lt;/code&gt; performs no field splitting at all: the entire
line lands in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$key&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$value&lt;/code&gt; is empty.&lt;/p&gt;

&lt;p&gt;Downstream, every lookup keyed on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$key&lt;/code&gt; misses, so a comparison script reports every object
missing — a dramatic, alarming, completely wrong result from a script with no errors in it.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;IFS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;$&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;               &lt;span class=&quot;c&quot;&gt;# correct&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With a caveat that produced the follow-on bug: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$&apos;\t&apos;&lt;/code&gt; contains a single quote character in its
&lt;em&gt;source form&lt;/em&gt;, so embedding it inside a single-quoted remote command terminates the quoting:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh host &lt;span class=&quot;s1&quot;&gt;&apos;IFS=$&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;; while read ...&apos;&lt;/span&gt;      &lt;span class=&quot;c&quot;&gt;# the wrapper quote closes early&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Workarounds exist (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$&apos;\&apos;&apos;&lt;/code&gt; gymnastics, double quotes with escaping), and all of them are harder
to read than the thing that actually works: put the script in a file, copy it over, run it.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;scp &lt;span class=&quot;nt&quot;&gt;-q&lt;/span&gt; parse.sh host:/tmp/ &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; ssh host &lt;span class=&quot;s1&quot;&gt;&apos;bash /tmp/parse.sh&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A useful habit for any loop over separated input — assert the split happened:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$value&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;field split failed on: &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$key&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&amp;amp;2&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;2-grep--c-prints-0-and-exits-non-zero&quot;&gt;2. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -c&lt;/code&gt; prints &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0&lt;/code&gt; and exits non-zero&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -c&lt;/code&gt; counts matches. With no matches it prints &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0&lt;/code&gt; &lt;strong&gt;and exits 1&lt;/strong&gt;, because grep’s exit
status reports whether anything matched, not whether the count succeeded.&lt;/p&gt;

&lt;p&gt;So the defensive idiom produces two lines:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; pattern file &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;0&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;# n is &quot;0\n0&quot; when there are no matches&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-gt&lt;/span&gt; 0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; ...                   &lt;span class=&quot;c&quot;&gt;# integer expression expected&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;|| echo 0&lt;/code&gt; fires &lt;em&gt;in addition to&lt;/em&gt; grep’s own &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0&lt;/code&gt;. Then an arithmetic test on a two-line
string fails with a syntax error, or worse, a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;case&lt;/code&gt; or string comparison silently takes the
wrong branch.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; pattern file&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;    &lt;span class=&quot;c&quot;&gt;# grep already printed 0&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# or&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; pattern file &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Same family: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wc -l &amp;lt; file&lt;/code&gt; on a file with no trailing newline undercounts by one, and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -q&lt;/code&gt; is the right tool whenever you only need the boolean.&lt;/p&gt;

&lt;h2 id=&quot;3-a-pipe-creates-a-subshell-and-environment-changes-die-in-it&quot;&gt;3. A pipe creates a subshell, and environment changes die in it&lt;/h2&gt;

&lt;p&gt;Any command whose effect is to modify the current shell’s environment is lost when it runs in a
pipeline, because each element of a pipeline is a subshell.&lt;/p&gt;

&lt;p&gt;This is how a module system gets wrongly accused:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;module load gcc/13 | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-5&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# loads in a subshell; PATH change discarded&lt;/span&gt;
gcc &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;                       &lt;span class=&quot;c&quot;&gt;# still the system gcc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The conclusion drawn from that transcript — “the module is broken, it gives the wrong compiler”
— is wrong, and the test is what produced it. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module&lt;/code&gt; is a shell function; piping it discards
exactly the thing it exists to do.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;module load gcc/13
gcc &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The same rule bites &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;read&lt;/code&gt; in the famous form:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cat &lt;/span&gt;file | &lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; l&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt;n+1&lt;span class=&quot;k&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;                 &lt;span class=&quot;c&quot;&gt;# empty: the loop ran in a subshell&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; l&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt;n+1&lt;span class=&quot;k&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; &amp;lt; file      &lt;span class=&quot;c&quot;&gt;# correct&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shopt -s lastpipe&lt;/code&gt; only helps in non-interactive shells with job control off, which is not
a thing to rely on in a script someone else will read.&lt;/p&gt;

&lt;h2 id=&quot;4-pgrep--f-matches-the-process-doing-the-matching&quot;&gt;4. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pgrep -f&lt;/code&gt; matches the process doing the matching&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pgrep -f&lt;/code&gt; matches against the full command line — including the command line of the shell that
is running your script, if the pattern appears in it.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pgrep &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;verify_objects&quot;&lt;/span&gt; | xargs &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;kill&lt;/span&gt;       &lt;span class=&quot;c&quot;&gt;# may include this very script&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The script’s own &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bash /path/verify_objects.sh&lt;/code&gt; contains the pattern. A kill list built this way
can include the session you are typing in. The symptom is a script that terminates itself
part-way through, intermittently, depending on how it was invoked.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pgrep &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/usr/bin/python3 /opt/verify/worker.py&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-vx&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# better: match the real binary, and exclude self explicitly&lt;/span&gt;
pgrep &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATTERN&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-vx&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-vx&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PPID&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Better still: have the workers write a PID file, or run them under a systemd scope and let
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemctl kill&lt;/code&gt; do it. String-matching process lists is a last resort.&lt;/p&gt;

&lt;h2 id=&quot;5-set--e-does-not-survive-a-pipeline-a-subshell-or-a-condition&quot;&gt;5. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set -e&lt;/code&gt; does not survive a pipeline, a subshell, or a condition&lt;/h2&gt;

&lt;p&gt;Three exemptions that make &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set -e&lt;/code&gt; much weaker than people assume:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;tee &lt;/span&gt;out            &lt;span class=&quot;c&quot;&gt;# exit status is tee&apos;s: zero. Script continues.&lt;/span&gt;
f&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; f &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;# the || suppresses it, as intended&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-q&lt;/span&gt; x file&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;# no exit here either, correctly&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set -o pipefail&lt;/code&gt; fixes the first. The general point is that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set -euo pipefail&lt;/code&gt; is a good
default and not a guarantee; anywhere the result matters, check it.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-euo&lt;/span&gt; pipefail
mmapplypolicy ... &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$OUT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;1
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$OUT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;policy produced no records&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&amp;amp;2&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;   &lt;span class=&quot;c&quot;&gt;# the real check&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That last line is the pattern worth taking away: tools that exit zero having done nothing are
common, and the only reliable test is on the artefact.&lt;/p&gt;

&lt;h2 id=&quot;6-locale-makes-sort-and-comm-disagree-between-hosts&quot;&gt;6. Locale makes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sort&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;comm&lt;/code&gt; disagree between hosts&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;comm&lt;/code&gt; requires both inputs sorted the same way, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sort&lt;/code&gt; honours &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LC_COLLATE&lt;/code&gt;. Collect a list
from two machines with different locale settings and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;comm&lt;/code&gt; produces nonsense — most visibly, the
same line appearing in both “only in A” and “only in B”, which is logically impossible and is
the tell.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh a &lt;span class=&quot;s1&quot;&gt;&apos;find ... | sort&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; a.txt      &lt;span class=&quot;c&quot;&gt;# sorted under a&apos;s locale&lt;/span&gt;
ssh b &lt;span class=&quot;s1&quot;&gt;&apos;find ... | sort&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; b.txt      &lt;span class=&quot;c&quot;&gt;# ... and b&apos;s&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;comm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-23&lt;/span&gt; a.txt b.txt                 &lt;span class=&quot;c&quot;&gt;# unreliable&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;C &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; a.txt &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; a.s&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;C &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; b.txt &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; b.s
&lt;span class=&quot;nv&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;C &lt;span class=&quot;nb&quot;&gt;comm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-23&lt;/span&gt; a.s b.s            &lt;span class=&quot;c&quot;&gt;# deterministic&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Pin &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LC_ALL=C&lt;/code&gt; for any comparison, and re-sort locally rather than trusting remote sort order.&lt;/p&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Cause&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Whole line in the first variable, rest empty&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IFS&lt;/code&gt; set from command substitution — it is empty&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;“integer expression expected” on a count&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -c&lt;/code&gt; printed 0 and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\|\| echo 0&lt;/code&gt; printed another&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Environment change has no effect&lt;/td&gt;
      &lt;td&gt;Ran inside a pipeline or subshell&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Script kills itself&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pgrep -f&lt;/code&gt; matched its own command line&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Failure reported as success&lt;/td&gt;
      &lt;td&gt;Pipeline exit status, no &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pipefail&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;A line is “only in A” and “only in B”&lt;/td&gt;
      &lt;td&gt;Inputs sorted under different locales&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Tool exits 0, output empty&lt;/td&gt;
      &lt;td&gt;Nothing asserted on the artefact&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;For each important step, check the row count, field split or output file as well as the command’s exit status. These examples pass through the shell successfully; the mistake becomes visible only when the resulting data is inspected.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>HPL-MxP: reading a mixed-precision result without fooling yourself</title>
    <link href="https://www.wirewalk.com/writing/hpl-mxp-mixed-precision/"/>
    <published>2026-09-01T00:00:00-04:00</published>
    <updated>2026-09-01T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/hpl-mxp-mixed-precision/</id>
    <summary>HPL-MxP reports a much larger number than HPL on the same machine. Knowing exactly where that factor comes from is the difference between a useful measurement and a marketing slide.</summary>
    <content type="html">&lt;p&gt;HPL-MxP, previously published as HPL-AI, solves the same problem as HPL using a different precision strategy. Its much larger score reflects how that strategy uses the hardware; it does not mean the machine became equally faster for every workload.&lt;/p&gt;

&lt;h2 id=&quot;what-it-does-differently&quot;&gt;What it does differently&lt;/h2&gt;

&lt;p&gt;Classic HPL performs the LU factorization entirely in double precision. HPL-MxP
performs the factorization in a lower precision, then repairs the answer.&lt;/p&gt;

&lt;p&gt;The sequence is:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Factorize the matrix in reduced precision, which is where the hardware’s
tensor or matrix units are fastest.&lt;/li&gt;
  &lt;li&gt;Use that low-precision factorization as a preconditioner.&lt;/li&gt;
  &lt;li&gt;Run an iterative refinement loop, in practice a Krylov solver such as GMRES,
until the residual meets the same accuracy standard classic HPL must meet.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The final answer satisfies the same correctness criterion. The path there spent
most of its time in arithmetic the hardware executes at several times the rate
of double precision.&lt;/p&gt;

&lt;p&gt;This is not a trick invented for benchmarking. Mixed-precision iterative
refinement is a legitimate, long-standing technique in numerical linear algebra,
and it is used in production solvers. The benchmark exists to reward hardware
that implements it well.&lt;/p&gt;

&lt;h2 id=&quot;where-the-big-number-comes-from&quot;&gt;Where the big number comes from&lt;/h2&gt;

&lt;p&gt;Here is the part that matters, and the part most often skipped.&lt;/p&gt;

&lt;p&gt;HPL-MxP does not report the number of low-precision operations it performed. It
reports the operation count of the &lt;strong&gt;equivalent double-precision HPL
algorithm&lt;/strong&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(2/3)N³ + 2N²&lt;/code&gt;, divided by the time the mixed-precision run
actually took.&lt;/p&gt;

&lt;p&gt;So the metric answers a specific question: &lt;em&gt;if you needed an HPL-accurate
solution to this system, how fast did you get one?&lt;/em&gt; That is a fair and useful
question. It is not the same question as “how many double-precision floating
point operations per second can this machine sustain,” and the answer must never
be substituted for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rmax&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;A machine’s HPL-MxP rate and its HPL &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rmax&lt;/code&gt; are not comparable quantities, and
the ratio between them is not an efficiency. It is a measure of how much the
low-precision units outrun the double-precision units on that hardware, filtered
through how well the refinement converged.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;what-actually-determines-the-result&quot;&gt;What actually determines the result&lt;/h2&gt;

&lt;p&gt;Three things move the number, and only one of them is raw hardware.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The precision used for the factorization.&lt;/strong&gt; FP16, BF16 and TF32 have different
dynamic range and different mantissa widths, and they are not interchangeable.
BF16 keeps FP32’s exponent range with a short mantissa, which makes it robust
against overflow but coarse. FP16 has a finer mantissa and a much narrower
range, so it needs scaling to stay numerically safe. Which one performs better
is a hardware question; which one converges better is a numerical one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How many refinement iterations were needed.&lt;/strong&gt; Every iteration costs time and
none of it counts toward the reported operation count, because the count is
fixed at the classic HPL figure. A run that converges in a handful of iterations
posts a strong number. A run that struggles posts a weak one even on identical
hardware. Convergence depends on the conditioning of the generated matrix and on
the precision choice, which is why the benchmark specifies how the matrix is
produced.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The usual HPL parameters.&lt;/strong&gt; Problem size, block size and process grid still
matter, and the tuning intuition carries over, though the optimum block size is
generally larger because the point is to keep wide matrix units saturated.&lt;/p&gt;

&lt;h2 id=&quot;when-it-is-worth-running&quot;&gt;When it is worth running&lt;/h2&gt;

&lt;p&gt;Run it if you are buying or operating hardware where the low-precision units are
a large fraction of what you are paying for. On a GPU cluster intended for
training workloads, the double-precision rate may be close to irrelevant to
everything the machine will actually do, and HPL alone will undersell it badly.&lt;/p&gt;

&lt;p&gt;Run it as a companion to HPL rather than a replacement. The pair tells you two
different things about the same machine: HPL gives you the double-precision
ceiling and a hardware health check, HPL-MxP gives you an indication of how well
the reduced-precision path performs on a problem with a verifiable answer.&lt;/p&gt;

&lt;p&gt;Do not run it expecting it to predict training throughput. It does not model
attention, it does not model collectives at scale, it does not model the data
pipeline, and it does not model memory capacity pressure. For that question,
measure collectives directly with nccl-tests and then measure your actual model.&lt;/p&gt;

&lt;h2 id=&quot;reporting-it-responsibly&quot;&gt;Reporting it responsibly&lt;/h2&gt;

&lt;p&gt;If you publish an HPL-MxP figure, publish the precision used for the
factorization, the iteration count, the problem size, and the classic HPL result
from the same machine alongside it. Those details allow another operator to reproduce the run and interpret the gain over double-precision HPL.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>AMD CPU analysis with uProf and IBS: follow the data across cores and cache domains</title>
    <link href="https://www.wirewalk.com/writing/amd-uprof-ibs-core-cache-numa-analysis/"/>
    <published>2026-08-27T10:00:00-04:00</published>
    <updated>2026-08-27T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/amd-uprof-ibs-core-cache-numa-analysis/</id>
    <summary>Investigate AMD CPU performance using topology, uProf event sampling and IBS, with explicit distinctions between core activity, cache domains, memory locality and data-fabric traffic.</summary>
    <content type="html">&lt;p&gt;Two thread-placement policies can use the same number of AMD CPU cores and produce different application times. The difference may come from shared-cache locality, memory placement, synchronization or the distribution of work across the processor’s topology.&lt;/p&gt;

&lt;p&gt;Before changing BIOS settings or adding threads, map the resources the application uses and identify the phase that is slow. AMD uProf and Instruction-Based Sampling can help connect that phase to execution and memory behavior, provided the observations are interpreted for the installed processor and tool release.&lt;/p&gt;

&lt;h2 id=&quot;map-the-topology-the-operating-system-exposes&quot;&gt;Map the topology the operating system exposes&lt;/h2&gt;

&lt;p&gt;Record the CPU family and model, core and SMT layout, NUMA domains, relevant firmware policy and the scheduler’s allowed CPU set. Do not use a processor’s marketing core count as the placement map for a job.&lt;/p&gt;

&lt;p&gt;Inspect the cache-sharing information the kernel exposes. A small read-only inventory can include:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lscpu &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;CPU,CORE,SOCKET,NODE
numactl &lt;span class=&quot;nt&quot;&gt;--hardware&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;cache_dir &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; /sys/devices/system/cpu/cpu0/cache/index&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;%s\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cache_dir&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cache_dir&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/level&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cache_dir&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/type&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cache_dir&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/size&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cache_dir&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/shared_cpu_list&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The cache view here begins with CPU 0. Inspect representative CPUs from other relevant groups before drawing a system-wide map. A cache domain and a NUMA node describe different relationships and should not be assumed to have identical membership.&lt;/p&gt;

&lt;p&gt;Keep firmware topology changes out of the initial experiment. If changing a supported NUMA-per-socket policy becomes justified, it is a separate maintenance operation with its own reboot and placement qualification.&lt;/p&gt;

&lt;h2 id=&quot;establish-where-threads-spend-time&quot;&gt;Establish where threads spend time&lt;/h2&gt;

&lt;p&gt;Start with elapsed time, correctness and a small representative input. Record the phase boundaries and the expected amount of useful work. A busy core might be computing, spinning or repeatedly retrying a failed operation.&lt;/p&gt;

&lt;p&gt;Use a supported uProf sampling configuration to identify hot functions and threads before requesting large hardware-event sets. Preserve symbols for the actual optimized executable and make the source mapping reproducible. Debug and optimized binaries can have different hot paths and memory access patterns.&lt;/p&gt;

&lt;p&gt;A low-overhead baseline and a more detailed collection are separate observations. Compare their elapsed times to estimate whether instrumentation materially changes the behavior under investigation. Do not treat a sampled profile’s total duration as the uninstrumented application result.&lt;/p&gt;

&lt;h2 id=&quot;keep-core-pmcs-ibs-and-fabric-observations-distinct&quot;&gt;Keep core PMCs, IBS and fabric observations distinct&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.amd.com/r/en-US/57368-uProf-user-guide/Hardware-Sources&quot;&gt;AMD’s uProf hardware-source documentation&lt;/a&gt; distinguishes hardware sources including core performance counters, IBS and data-fabric counters on supported processors. They provide different views of execution.&lt;/p&gt;

&lt;p&gt;Core counters measure selected events within their supported scope. IBS samples information associated with instruction fetch or execution operations, with model-dependent fields and filtering. Data-fabric observations cover resources beyond one core and may include activity from other work.&lt;/p&gt;

&lt;p&gt;Use the installed tool’s supported profile and event definitions for the exact processor. An event encoding or derived metric from one Zen generation should not be copied into another generation’s report without checking its meaning and availability.&lt;/p&gt;

&lt;p&gt;Retain tool and event-definition versions with the results. A friendly label in a report is not enough to reconstruct what was counted or sampled.&lt;/p&gt;

&lt;p&gt;For interval monitoring on supported AMD processors, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AMDuProfPcm&lt;/code&gt; provides selected core and memory-system measurements. Preserve its model-specific configuration, sampling interval and processor coverage. Treat platform-level output as shared-system evidence until the experiment establishes which workload produced the activity.&lt;/p&gt;

&lt;h2 id=&quot;use-ibs-to-narrow-an-expensive-access-pattern&quot;&gt;Use IBS to narrow an expensive access pattern&lt;/h2&gt;

&lt;p&gt;Find the hot code and the relevant load or instruction region, then inspect the supported IBS evidence about its behavior. Keep sample counts and confidence in view. A few expensive samples may identify a lead but are not a reliable distribution of all accesses.&lt;/p&gt;

&lt;p&gt;Determine what the tool reports about cache service, locality and latency for the processor in question. Do not invent unavailable fields or convert an unknown source into a local-cache hit. Keep data-source categories and aggregate PMU traffic separate until their relationship is understood.&lt;/p&gt;

&lt;p&gt;The older &lt;a href=&quot;https://www.amd.com/content/dam/amd/en/documents/developer/version-4-2-documents/uprof/uprof-user-guide-v4.2.pdf&quot;&gt;uProf 4.2 guide&lt;/a&gt; is a useful historical reference for established IBS capabilities. Current uProf features may be broader; match the interpretation to the version that produced the report.&lt;/p&gt;

&lt;h2 id=&quot;test-locality-with-a-controlled-initialization-policy&quot;&gt;Test locality with a controlled initialization policy&lt;/h2&gt;

&lt;p&gt;Memory placement depends on how memory is allocated and touched, not just where the later compute threads run. Record initialization threads, placement policy and whether data is reused across phases.&lt;/p&gt;

&lt;p&gt;Compare a qualified local-placement run with another deliberately chosen policy, keeping input and allowed resources fixed. Observe application time, placement evidence and relevant memory traffic. Do not infer remote access merely because threads span sockets; the pages and access pattern must support that explanation.&lt;/p&gt;

&lt;p&gt;Use only CPUs and memory resources available to the allocation. A profiling wrapper that overrides scheduler affinity can produce an impressive result while measuring a service users are not actually allowed to run.&lt;/p&gt;

&lt;h2 id=&quot;separate-shared-cache-pressure-from-communication-costs&quot;&gt;Separate shared-cache pressure from communication costs&lt;/h2&gt;

&lt;p&gt;Vary working-set size while preserving the algorithm and useful work definition. Look for changes in the relationship between elapsed time, supported cache observations and memory traffic. Account for extra initialization and allocation costs as the dataset changes.&lt;/p&gt;

&lt;p&gt;Then vary placement across known cache-sharing groups. Keeping cooperating threads close can help some workloads, while separating independent bandwidth-heavy work can help others. The architecture map informs the experiment; it does not choose the winner in advance.&lt;/p&gt;

&lt;p&gt;For writable shared data, inspect ownership and layout. A cache line moving between cores can reflect necessary communication or avoidable false sharing. Change one suspected object or partition boundary and verify the result. Adding padding everywhere can increase memory footprint and lose useful locality elsewhere.&lt;/p&gt;

&lt;h2 id=&quot;interpret-core-utilization-and-frequency-carefully&quot;&gt;Interpret core utilization and frequency carefully&lt;/h2&gt;

&lt;p&gt;A fully occupied logical CPU does not necessarily perform useful application work. Examine synchronization, imbalance and instruction behavior. Count completed items or iterations alongside CPU time and hardware observations.&lt;/p&gt;

&lt;p&gt;Record whether SMT siblings are active and whether the frequency measurement is sampled, requested or otherwise derived. Avoid comparing nominal clock specifications with a workload’s effective execution rate as though they were the same quantity.&lt;/p&gt;

&lt;p&gt;If several jobs share a socket, fabric and memory-channel observations may be contaminated by their activity. Prefer an agreed profiling allocation or describe the shared load explicitly. Do not assign the socket’s entire traffic to the one process that happened to be instrumented.&lt;/p&gt;

&lt;h2 id=&quot;retain-a-result-another-administrator-can-repeat&quot;&gt;Retain a result another administrator can repeat&lt;/h2&gt;

&lt;p&gt;The final record should contain the workload, executable, CPU model, topology, allowed placement, profile configuration, supporting observations and the controlled change that tested the explanation. Repeat the application without the profiler and validate output.&lt;/p&gt;

&lt;p&gt;For GPU-fed research pipelines, confirm whether the CPU change shortens the actual input or communication stage. A faster CPU microbenchmark is useful evidence about a component; it is not proof that training completed sooner.&lt;/p&gt;

&lt;p&gt;Compare this workflow with &lt;a href=&quot;/writing/intel-vtune-pcm-core-cache-memory-analysis/&quot;&gt;Intel VTune and PCM analysis&lt;/a&gt;. The experimental discipline carries across vendors, while cache topology, event definitions and the interpretation of samples remain specific to the hardware.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>HPCG: the benchmark that tells you what the memory system can do</title>
    <link href="https://www.wirewalk.com/writing/hpcg-benchmarking/"/>
    <published>2026-08-26T00:00:00-04:00</published>
    <updated>2026-08-26T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/hpcg-benchmarking/</id>
    <summary>HPCG reaches a small percentage of peak and that is the entire point. It measures the parts of the machine that actually limit most scientific codes.</summary>
    <content type="html">&lt;p&gt;HPCG was developed by the HPL authors to exercise the memory and communication costs that dense Linpack work largely avoids. Its sparse, irregular operations provide a useful second view of an HPC system alongside HPL.&lt;/p&gt;

&lt;p&gt;Expect a much smaller fraction of theoretical peak. A low single-digit percentage can be normal for HPCG because moving the data and coordinating the work limit how quickly the floating-point units can be fed.&lt;/p&gt;

&lt;h2 id=&quot;what-it-actually-runs&quot;&gt;What it actually runs&lt;/h2&gt;

&lt;p&gt;HPCG solves a sparse linear system with a preconditioned conjugate gradient
method. The preconditioner is a geometric multigrid with a symmetric
Gauss-Seidel smoother, and that choice is what makes the benchmark hard in an
interesting way.&lt;/p&gt;

&lt;p&gt;Symmetric Gauss-Seidel is inherently sequential in its data dependencies. You
cannot simply vectorize your way out of it the way you can with a dense matrix
multiply. Implementations have to reorder, color or otherwise restructure the
sweep to expose parallelism, and doing that changes the convergence behavior,
which the benchmark checks. The rules constrain how much you are allowed to
change, which is what stops HPCG from degenerating into the same optimization
contest HPL became.&lt;/p&gt;

&lt;p&gt;The result is a benchmark dominated by sparse matrix-vector products, which
means streaming large arrays with indirect indexing. Arithmetic intensity is
low. Every cycle spent waiting on a cache miss is a cycle the floating point
units sit idle.&lt;/p&gt;

&lt;h2 id=&quot;configuration&quot;&gt;Configuration&lt;/h2&gt;

&lt;p&gt;The input is small. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hpcg.dat&lt;/code&gt; takes a local problem size per rank and a run
time:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;HPCG benchmark input file
Sandia National Laboratories; University of Tennessee, Knoxville
104 104 104
1800
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The three numbers are the local subdomain dimensions &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nx ny nz&lt;/code&gt;, and they must
each be a multiple of eight. The fourth is the target run time in seconds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sizing the local domain.&lt;/strong&gt; The subdomain has to be large enough that it does
not fit comfortably in cache, or you are benchmarking cache and the result is
meaningless. A reasonable approach is to size it so the working set is a
substantial fraction of the memory you want to represent per rank, then confirm
that increasing it further does not change the reported rate much. When the
number stops moving, you are measuring DRAM rather than last-level cache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run time.&lt;/strong&gt; For an official submission the timed run must be at least 1800
seconds. For internal use you can run shorter, but be aware that short runs
overweight the setup phase and flatter the machine slightly.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;HPCG will happily produce a large number if you give it a small local domain.
This is the single most common way sites accidentally publish a wrong HPCG
result. Sweep the local size upward and take the value from the plateau, not
from the peak.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;what-the-output-tells-you&quot;&gt;What the output tells you&lt;/h2&gt;

&lt;p&gt;HPCG writes a YAML file with a full breakdown. The headline &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GFLOP/s&lt;/code&gt; rating is
what gets quoted, but the per-phase timings underneath are more useful
operationally, because they separate the sparse matrix-vector product, the
symmetric Gauss-Seidel sweeps, the dot products and the halo exchange.&lt;/p&gt;

&lt;p&gt;Those phases fail differently:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The &lt;strong&gt;matrix-vector and smoother&lt;/strong&gt; phases track memory bandwidth. If they
regress, look at DIMM population, memory clock, NUMA balance and whether
something changed in the BIOS power profile.&lt;/li&gt;
  &lt;li&gt;The &lt;strong&gt;dot products&lt;/strong&gt; are global reductions, so they track collective latency
and, more importantly, jitter. A single noisy node shows up here first.&lt;/li&gt;
  &lt;li&gt;The &lt;strong&gt;halo exchange&lt;/strong&gt; tracks neighbor communication, which is point-to-point
and usually fine unless the topology mapping is poor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That decomposition is why HPCG is worth running even when nobody is asking for
a TOP500-style number. It is a repeatable, structured way of asking whether the
memory subsystem and the collective path are behaving the way they did last
quarter.&lt;/p&gt;

&lt;h2 id=&quot;where-it-fits-against-hpl&quot;&gt;Where it fits against HPL&lt;/h2&gt;

&lt;p&gt;Run both. They fail for different reasons and finding the difference is
diagnostic.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt; &lt;/th&gt;
      &lt;th&gt;HPL&lt;/th&gt;
      &lt;th&gt;HPCG&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Limited by&lt;/td&gt;
      &lt;td&gt;Floating point throughput&lt;/td&gt;
      &lt;td&gt;Memory bandwidth, latency&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Fraction of peak&lt;/td&gt;
      &lt;td&gt;High&lt;/td&gt;
      &lt;td&gt;Low&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Sensitive to&lt;/td&gt;
      &lt;td&gt;Clocks, BLAS, thermals&lt;/td&gt;
      &lt;td&gt;DIMM config, NUMA, jitter&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Representative of&lt;/td&gt;
      &lt;td&gt;Dense linear algebra&lt;/td&gt;
      &lt;td&gt;Most sparse scientific codes&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;If HPL holds steady and HPCG drops, suspect memory configuration or a change in
NUMA behavior rather than the processors. If both drop together, suspect clocks,
power or cooling. If HPCG holds and HPL drops, suspect the math library or a
thermal limit that only sustained dense work reaches.&lt;/p&gt;

&lt;p&gt;Keep both baselines, then compare them with the applications the machine is meant to run. Their different sensitivities help narrow an investigation, even though neither score predicts application performance on its own.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>InfiniBand error counters: read deltas, not totals</title>
    <link href="https://www.wirewalk.com/writing/infiniband-error-counters-deltas-not-totals/"/>
    <published>2026-08-24T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/infiniband-error-counters-deltas-not-totals/</id>
    <summary>Port counters are cumulative since the last reset, so a large number may be five years of history and a small one may be happening right now. Only a delta over a known window tells you whether a link is degrading.</summary>
    <content type="html">&lt;p&gt;Someone runs a fabric error sweep, finds a port with a symbol error count in the millions, and
schedules a cable replacement. The count is real. It may also be the accumulated total since the
switch was commissioned four years ago, in which case the cable is fine and the maintenance
window is wasted.&lt;/p&gt;

&lt;p&gt;Error counters on InfiniBand ports are &lt;strong&gt;cumulative since last reset&lt;/strong&gt;. A total is close to
uninterpretable on its own.&lt;/p&gt;

&lt;h2 id=&quot;the-only-reading-that-means-anything-is-a-delta&quot;&gt;The only reading that means anything is a delta&lt;/h2&gt;

&lt;p&gt;Take two samples with a known interval between them and subtract.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# sample, wait, sample again&lt;/span&gt;
ibqueryerrors &lt;span class=&quot;nt&quot;&gt;--counters&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /tmp/err.t0
&lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;900
ibqueryerrors &lt;span class=&quot;nt&quot;&gt;--counters&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /tmp/err.t1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or reset deliberately and come back:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;perfquery &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt;                 &lt;span class=&quot;c&quot;&gt;# reset all counters on all ports&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# ... run a representative load for a known period ...&lt;/span&gt;
perfquery &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-vE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos; 0$&apos;&lt;/span&gt;   &lt;span class=&quot;c&quot;&gt;# anything non-zero accumulated in that window&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Resetting is the cleaner experiment and the one to prefer before a benchmark or an acceptance
test: a window that starts at zero needs no arithmetic and no trust in a previous sample. The
cost is that you have destroyed the history, so capture it first if anyone might want it.&lt;/p&gt;

&lt;p&gt;What you are looking for is &lt;strong&gt;rate per unit time on a link carrying traffic&lt;/strong&gt;. A handful of
symbol errors over fifteen minutes of heavy traffic on an NDR link is not interesting. The same
count on an idle link is, because the mechanism had almost no opportunity.&lt;/p&gt;

&lt;p&gt;That asymmetry is why the sweep should record whether the link was loaded. “Zero errors” on a
fabric nobody is using is not a result.&lt;/p&gt;

&lt;h2 id=&quot;which-counters-carry-which-meaning&quot;&gt;Which counters carry which meaning&lt;/h2&gt;

&lt;p&gt;Not all non-zero counters imply the same thing, and conflating them produces both false alarms
and missed faults.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Counter&lt;/th&gt;
      &lt;th&gt;Reads as&lt;/th&gt;
      &lt;th&gt;Typical cause&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SymbolErrorCounter&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Physical layer noise&lt;/td&gt;
      &lt;td&gt;Cable, connector seating, transceiver, bend radius&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LinkErrorRecoveryCounter&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Link retrained and recovered&lt;/td&gt;
      &lt;td&gt;Marginal physical layer&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LinkDownedCounter&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Link went fully down&lt;/td&gt;
      &lt;td&gt;Reseat, power event, port flap, firmware&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortRcvErrors&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Malformed or corrupted inbound packets&lt;/td&gt;
      &lt;td&gt;Usually downstream of symbol errors&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitDiscards&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Packets dropped at egress&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;Congestion or credit starvation, not a cable&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Time waiting for credits&lt;/td&gt;
      &lt;td&gt;Congestion; routing imbalance; a slow endpoint&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VL15Dropped&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Management packets dropped&lt;/td&gt;
      &lt;td&gt;SM load, or a genuinely saturated port&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ExcessiveBufferOverrunErrors&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Flow control problem&lt;/td&gt;
      &lt;td&gt;Mismatched MTU/credits, firmware&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The important split: the first four are &lt;strong&gt;physical&lt;/strong&gt;; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitDiscards&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt; are
&lt;strong&gt;architectural&lt;/strong&gt;. A port with high &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;XmitWait&lt;/code&gt; and zero symbol errors does not have a cable
problem — it has more demand than credits, and replacing the cable will change nothing. That is
the single most common misdiagnosis in this area, because both appear in the same error sweep
output under the same heading.&lt;/p&gt;

&lt;p&gt;High &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;XmitWait&lt;/code&gt; concentrated on inter-switch links is a routing or provisioning finding: the
links are being asked to carry more than they can, or the routing algorithm has put more traffic
on some of them than others. That is a topology conversation, not a hardware one.&lt;/p&gt;

&lt;h2 id=&quot;a-degraded-link-is-not-necessarily-an-erroring-link&quot;&gt;A degraded link is not necessarily an erroring link&lt;/h2&gt;

&lt;p&gt;Separate from counters, a link can negotiate a lower width or rate and sit there perfectly
healthy, with zero errors, reporting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Active&lt;/code&gt;. Four lanes becoming one is a 4x bandwidth loss
with no error counter movement at all.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;iblinkinfo | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-vE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;4X +(53|106|212)&apos;&lt;/span&gt;      &lt;span class=&quot;c&quot;&gt;# anything not 4X at the expected per-lane rate&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two traps in reading that output, both of which produce wrong capacity conclusions:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;The rate field is per lane.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;106.25 Gbps&lt;/code&gt; on a 4X link is NDR400, not 106 Gbps of link
capacity. Multiply by the width.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Width is reported as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1X&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2X&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4X&lt;/code&gt;&lt;/strong&gt; and a 2X link looks almost identical to a 4X one in a
quick scan. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep&lt;/code&gt; for what you expect rather than eyeballing a long listing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why this matters more than the error count: on a &lt;strong&gt;synchronized collective&lt;/strong&gt;, the job proceeds at
the speed of its slowest participant. One node at half width sets the time for every rank. So a
single silently degraded link can look exactly like a fabric-wide bandwidth problem, and chasing
it as a fabric problem — tunables, routing, firmware — can absorb days. Check every participant’s
width and rate &lt;strong&gt;before&lt;/strong&gt; you accept any synchronized benchmark number. A withdrawn performance
claim is the usual price of skipping it.&lt;/p&gt;

&lt;h2 id=&quot;build-the-sweep-so-it-can-be-compared&quot;&gt;Build the sweep so it can be compared&lt;/h2&gt;

&lt;p&gt;An error sweep is only useful against a baseline, so the output needs to be diffable.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# one line per port, stable field order, so two runs can be diffed&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-uo&lt;/span&gt; pipefail
&lt;span class=&quot;nv&quot;&gt;OUT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;/var/log/ibsweep/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; +%Y%m%d-%H%M&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.tsv&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;dirname&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$OUT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
ibqueryerrors &lt;span class=&quot;nt&quot;&gt;--counters&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--data&lt;/span&gt; 2&amp;gt;/dev/null &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;/^Errors for/ {gid=$NF} /Counter/ {print gid&quot;\t&quot;$0}&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$OUT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$OUT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then the operational question becomes a diff rather than a judgement:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;diff &amp;lt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f1&lt;/span&gt;,2 baseline.tsv&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &amp;lt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f1&lt;/span&gt;,2 &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$OUT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-40&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two further practices that make the sweep trustworthy:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Record the window and the load.&lt;/strong&gt; A sweep row without “15 minutes, under IOR” next to it
cannot be compared with anything.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Alert on the delta, not the total.&lt;/strong&gt; A threshold on a cumulative counter fires once and then
fires forever, which trains everyone to ignore it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;an-order-of-operations&quot;&gt;An order of operations&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Capture the current totals, so history is not lost.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery -R -a&lt;/code&gt; to reset.&lt;/li&gt;
  &lt;li&gt;Confirm width and rate on every link you care about — this is independent of counters and
catches the silent case.&lt;/li&gt;
  &lt;li&gt;Run a representative load for a fixed period.&lt;/li&gt;
  &lt;li&gt;Re-read counters. Anything non-zero accumulated inside a known window with known load.&lt;/li&gt;
  &lt;li&gt;Split the findings: physical counters to hardware, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;XmitWait&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Discards&lt;/code&gt; to topology.&lt;/li&gt;
  &lt;li&gt;Re-seat or replace one thing at a time, and repeat the windowed measurement. A fix is a
counter that stays at zero through a load, not a counter you just reset.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 7’s last sentence is where most of the remaining errors come from: resetting a counter and
observing zero proves only that you reset it.&lt;/p&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Likely reading&lt;/th&gt;
      &lt;th&gt;Next step&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Huge symbol error total, link stable&lt;/td&gt;
      &lt;td&gt;Years of accumulation&lt;/td&gt;
      &lt;td&gt;reset, re-measure under load&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Errors climbing on an idle link&lt;/td&gt;
      &lt;td&gt;Genuine physical fault&lt;/td&gt;
      &lt;td&gt;reseat, then swap cable&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;High &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;XmitWait&lt;/code&gt;, zero symbol errors&lt;/td&gt;
      &lt;td&gt;Congestion or routing imbalance&lt;/td&gt;
      &lt;td&gt;topology, not cabling&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LinkDowned&lt;/code&gt; incrementing&lt;/td&gt;
      &lt;td&gt;Flapping&lt;/td&gt;
      &lt;td&gt;check both ends, power, firmware&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Zero errors, poor collective performance&lt;/td&gt;
      &lt;td&gt;A link at reduced width or rate&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt;, mind per-lane rate&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Clean sweep, no traffic during it&lt;/td&gt;
      &lt;td&gt;The window had no load&lt;/td&gt;
      &lt;td&gt;repeat under load&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Attach the sampling window and workload to every reported counter change. That lets the maintenance team distinguish an active fault from old history before replacing a cable.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>HPL: what Linpack actually measures, and what it is good for</title>
    <link href="https://www.wirewalk.com/writing/hpl-benchmarking/"/>
    <published>2026-08-19T00:00:00-04:00</published>
    <updated>2026-08-19T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/hpl-benchmarking/</id>
    <summary>HPL is a poor predictor of application performance and an excellent acceptance test. Those two statements are both true, and confusing them is how people end up tuning the wrong thing.</summary>
    <content type="html">&lt;p&gt;High Performance Linpack solves a dense system of linear equations using LU factorization with partial pivoting, in double precision across a process grid. Its TOP500 role makes the score familiar, but the most useful local comparison is often the same machine before and after a change.&lt;/p&gt;

&lt;p&gt;Use HPL to exercise dense compute and look for regressions. Use application runs and complementary benchmarks to assess workloads that depend more heavily on memory, communication or I/O.&lt;/p&gt;

&lt;h2 id=&quot;why-it-flatters-hardware&quot;&gt;Why it flatters hardware&lt;/h2&gt;

&lt;p&gt;The work HPL does is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(2/3)N³ + 2N²&lt;/code&gt; floating point operations, and almost all of
it lands in large dense matrix multiplies. That is the single most favorable
operation any processor has: high arithmetic intensity, perfectly predictable
access, and vendor-tuned kernels behind it.&lt;/p&gt;

&lt;p&gt;So HPL reaches a high fraction of theoretical peak, and a well-tuned run on
sensible hardware lands in the region of sixty to ninety percent of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rpeak&lt;/code&gt;.
Very little real scientific code behaves this way. Most applications are limited
by memory bandwidth, sparse or irregular access, latency, or synchronization,
none of which HPL exercises meaningfully.&lt;/p&gt;

&lt;p&gt;That is precisely why HPCG was created as a counterweight, and it is why quoting
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rmax&lt;/code&gt; as a procurement figure of merit for a mixed workload is close to
meaningless.&lt;/p&gt;

&lt;h2 id=&quot;the-parameters-that-matter&quot;&gt;The parameters that matter&lt;/h2&gt;

&lt;p&gt;Everything lives in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HPL.dat&lt;/code&gt;. Most of its knobs are noise; four are not.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Parameter&lt;/th&gt;
      &lt;th&gt;What it controls&lt;/th&gt;
      &lt;th&gt;Practical guidance&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Problem size&lt;/td&gt;
      &lt;td&gt;Fill most of aggregate memory, leaving headroom&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NB&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Block size&lt;/td&gt;
      &lt;td&gt;Match the BLAS kernel’s preference&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;P&lt;/code&gt; × &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Q&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Process grid&lt;/td&gt;
      &lt;td&gt;As close to square as possible, with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;P&lt;/code&gt; ≤ &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Q&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BCAST&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Broadcast algorithm&lt;/td&gt;
      &lt;td&gt;Try a few; the ring variants usually win at scale&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Sizing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N&lt;/code&gt;.&lt;/strong&gt; The matrix is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N × N&lt;/code&gt; in eight-byte doubles, so memory is
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;8N²&lt;/code&gt; bytes plus workspace. Solve for the memory you want to use:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;N ≈ sqrt( total_bytes × utilization / 8 )
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Utilization around 0.8 is a reasonable starting point. Push it too high and the
run swaps or the OOM killer intervenes several hours in; too low and you spend
proportionally more time in the parts of the algorithm that do not scale, and
the result understates the machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choosing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NB&lt;/code&gt;.&lt;/strong&gt; This is the blocking factor the factorization uses, and the
right value is whatever the underlying BLAS wants. CPU runs with a tuned library
typically want something in the low hundreds. GPU runs, particularly through a
vendor container, want considerably larger blocks, because the point is to keep
the device busy with big multiplies. Do not carry a CPU value across to a GPU
run and expect it to hold.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The grid.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;P × Q&lt;/code&gt; must equal the number of MPI ranks. The panel
factorization runs down columns of the grid and the update broadcasts across
rows, so a grid that is far from square puts a disproportionate amount of the
serial-ish work in one dimension. Square, or slightly wider than tall, is the
rule.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Sizing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N&lt;/code&gt; to fill memory means a full run takes hours. Do your parameter sweeps
at a small &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N&lt;/code&gt; where a run takes minutes, find the shape of the answer, then do
one or two large runs to get the real number. People routinely burn a week
tuning at full size.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;where-it-earns-its-keep&quot;&gt;Where it earns its keep&lt;/h2&gt;

&lt;p&gt;Run HPL at close to full memory across every node, and you have built a
sustained, uniform, several-hour stress test that touches nearly all of DRAM,
nearly all of the floating point units, and the interconnect between every pair
of ranks. It is the best acceptance test most sites have, and it finds things:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Nodes that thermally throttle only once the whole rack is hot, which no
single-node test will reproduce.&lt;/li&gt;
  &lt;li&gt;Correctable memory errors that appear only when a large fraction of DRAM is
touched repeatedly.&lt;/li&gt;
  &lt;li&gt;One node whose BIOS profile differs from its siblings, which shows up as the
whole job running at the speed of that node.&lt;/li&gt;
  &lt;li&gt;Links that negotiated at a lower width or rate than expected.&lt;/li&gt;
  &lt;li&gt;Power delivery and cooling limits that only appear at full draw.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HPL prints a residual check at the end. Treat a failed residual as a hardware
fault until proven otherwise, because that is usually what it is. A machine that
returns wrong arithmetic under load is a much more urgent finding than a
disappointing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rmax&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;reading-the-result-honestly&quot;&gt;Reading the result honestly&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rmax&lt;/code&gt; is the best rate achieved. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rpeak&lt;/code&gt; is the theoretical maximum from clock
rate, core count and per-cycle floating point width. Efficiency is the ratio,
and it is the number worth tracking, because it is comparable across time on the
same machine.&lt;/p&gt;

&lt;p&gt;A drop in efficiency between two runs of the same configuration is a real
signal. An absolute efficiency number compared against a different site’s
machine is mostly a comparison of two vendors’ BLAS libraries and two people’s
patience with parameter sweeps.&lt;/p&gt;

&lt;p&gt;Rerun the same HPL configuration after firmware and driver changes, alongside HPCG and representative applications. The combination shows more about the machine than any one score.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Node-local state and the reimage that erases it</title>
    <link href="https://www.wirewalk.com/writing/node-local-state-and-the-reimage-that-erases-it/"/>
    <published>2026-08-17T00:00:00-04:00</published>
    <updated>2026-10-17T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/node-local-state-and-the-reimage-that-erases-it/</id>
    <summary>A fix applied to a running node survives until that node is reimaged, and then it is gone with no event to connect the two. The decision that prevents it is knowing which changes are node-local and which live on shared storage.</summary>
    <content type="html">&lt;p&gt;A node misbehaves, you fix it, you verify the fix, you move on. Eight weeks later the same node
shows the same fault. Nothing changed in between — except that the node was reimaged for a
kernel update, and the fix lived in its local filesystem.&lt;/p&gt;

&lt;p&gt;Before making the repair, find out where the changed file lives and what will recreate it. A live node, its provisioning image and a shared filesystem can require three different update procedures.&lt;/p&gt;

&lt;h2 id=&quot;classify-the-change-before-making-it&quot;&gt;Classify the change before making it&lt;/h2&gt;

&lt;p&gt;Every configuration change in a cluster lands in one of three places, and the place determines
what you have to do to make it durable.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Where it lives&lt;/th&gt;
      &lt;th&gt;Survives reimage?&lt;/th&gt;
      &lt;th&gt;What durability requires&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Node-local filesystem (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var&lt;/code&gt;, local units)&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;No&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;bake into the image, or manage it from config management&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Shared filesystem (parallel FS, NFS-mounted app tree)&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
      &lt;td&gt;nothing — one edit reaches every node&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Provisioning system’s own database (node records, roles, kernel params)&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
      &lt;td&gt;commit it there, not on the node&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The practical test is a single command. If the path is a mount from shared storage, the change
is global and already durable:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;findmnt &lt;span class=&quot;nt&quot;&gt;--target&lt;/span&gt; /the/path &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; SOURCE,FSTYPE,TARGET
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This matters more than it sounds, because adjacent paths frequently differ. A software tree can
be a shared mount while its &lt;strong&gt;parent directory is local disk&lt;/strong&gt; — so an edit one level up is
node-local even though everything below it is global. One cluster can have a tool tree on shared
storage where another has the same path on local disk, which is exactly how a procedure that
worked on one cluster silently fails on the next.&lt;/p&gt;

&lt;p&gt;Things that are almost always node-local and get forgotten: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/motd&lt;/code&gt; and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/motd.d&lt;/code&gt;, PAM stacks, sshd config, systemd units and drop-ins, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/fstab&lt;/code&gt;,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/security/limits.d&lt;/code&gt;, cgroup and slice configuration, local firewall rules, node exporter
collectors in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var/lib&lt;/code&gt;, and anything written into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/profile.d&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Things that are usually shared: the application and module trees on a parallel filesystem, which
is why a module fix is a one-time edit and a PAM fix is a fleet operation.&lt;/p&gt;

&lt;h2 id=&quot;per-node-overrides-defeat-the-category-default&quot;&gt;Per-node overrides defeat the category default&lt;/h2&gt;

&lt;p&gt;The trap that turns a correct bake into a no-op. Provisioning systems let you assign an image at
the &lt;strong&gt;group or category&lt;/strong&gt; level, and then let individual nodes &lt;strong&gt;override&lt;/strong&gt; it. Both are normal
and both are used.&lt;/p&gt;

&lt;p&gt;So you bake your change into the category’s image, verify the file is present in that image,
reboot the node — and the change is not there, because the node has its own image assigned and
the category default was never consulted.&lt;/p&gt;

&lt;p&gt;Enumerate what each node actually resolves to, not what the category says:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;n &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;login001 login002 node041 node042&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%-10s category=%-10s image=%s&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;cmsh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;device use &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;; get category&quot;&lt;/span&gt; 2&amp;gt;/dev/null&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;cmsh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;device use &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;; get softwareimage&quot;&lt;/span&gt; 2&amp;gt;/dev/null&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then bake into &lt;strong&gt;every image that is actually assigned&lt;/strong&gt;, plus the category default so that
future nodes inherit it. A fleet of four login nodes can easily be four distinct images.&lt;/p&gt;

&lt;p&gt;The matching hazard in the other direction: a category’s default image may be &lt;strong&gt;shared with a
different class of machine&lt;/strong&gt;. If the login category’s default image is the general compute
image, baking a login-specific change into it reaches every compute node too. Check what else
uses an image before writing to it:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cmsh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;softwareimage use &amp;lt;image&amp;gt;; show&quot;&lt;/span&gt; 2&amp;gt;/dev/null
cmsh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;device list&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{print $4}&apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;uniq&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt;    &lt;span class=&quot;c&quot;&gt;# nodes per category&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;verify-from-the-image-not-from-the-copy&quot;&gt;Verify from the image, not from the copy&lt;/h2&gt;

&lt;p&gt;Writing into an image is a file copy into a directory tree, and file copies succeed in ways that
do not accomplish the goal — wrong path inside the tree, a stale file still present beside the
new one, the right content with the wrong mode.&lt;/p&gt;

&lt;p&gt;So read back from the image path and assert on content:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;IMG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/cm/images/login-2026-10
&lt;span class=&quot;nv&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$IMG&lt;/span&gt;/etc/motd.d/userinfo.motd

&lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; 644 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; root &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; root ./userinfo.motd &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$F&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# assertions, from the image tree&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;  files in motd.d : %s (want 1)&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$IMG&lt;/span&gt;/etc/motd.d | &lt;span class=&quot;nb&quot;&gt;wc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;  legacy motd     : %s lines (want 0)&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$IMG&lt;/span&gt;/etc/motd &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;wc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &amp;lt; &lt;span class=&quot;nv&quot;&gt;$IMG&lt;/span&gt;/etc/motd &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;0&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;  content marker  : %s (want &amp;gt;=1)&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;sbatch&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$F&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;  mode            : %s (want 644)&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;stat&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; %a &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$F&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;files in motd.d&lt;/code&gt; line is the one that catches the real mistake. Baking a new file while an
old one is still in a drop-in directory means the node boots with both, because that kind of
directory uses every file in it. An image is where those leftovers persist indefinitely.&lt;/p&gt;

&lt;h2 id=&quot;make-the-live-fix-and-the-baked-fix-one-operation&quot;&gt;Make the live fix and the baked fix one operation&lt;/h2&gt;

&lt;p&gt;The reason fixes get lost is that applying them live and baking them are two separate acts, and
the second one is the one that gets skipped under time pressure. The fix is to make them the
same script, parameterised by target root:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apply&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;           &lt;span class=&quot;c&quot;&gt;# apply &quot;&quot; for live, apply /cm/images/&amp;lt;img&amp;gt; for an image&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; 644 ./userinfo.motd &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$R&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/etc/motd.d/userinfo.motd&quot;&lt;/span&gt;
  : &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$R&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/etc/motd&quot;&lt;/span&gt;
  find &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$R&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/etc/motd.d&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-name&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;*.bak*&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$R&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/root/motd-backups/&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; +
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

apply &lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;                                  &lt;span class=&quot;c&quot;&gt;# the running node&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;i &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; /cm/images/login-&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;apply &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;   &lt;span class=&quot;c&quot;&gt;# every image that provisions one&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Run the same assertions against both roots. Then the question “is this durable” has a mechanical
answer rather than depending on whether anyone remembered.&lt;/p&gt;

&lt;h2 id=&quot;a-reimage-checklist&quot;&gt;A reimage checklist&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Which paths did I change? &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;findmnt --target&lt;/code&gt; each one.&lt;/li&gt;
  &lt;li&gt;For node-local paths: which images provision this node, &lt;strong&gt;including per-node overrides&lt;/strong&gt;?&lt;/li&gt;
  &lt;li&gt;Is any of those images shared with a different class of node?&lt;/li&gt;
  &lt;li&gt;Apply to the running node and to every image, from one script.&lt;/li&gt;
  &lt;li&gt;Assert on content read back from the image tree, not on the copy’s exit status.&lt;/li&gt;
  &lt;li&gt;Confirm the drop-in directories in the image contain only what should be there.&lt;/li&gt;
  &lt;li&gt;Record which images were touched, so the next person updating one does not drop your change.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Cause&lt;/th&gt;
      &lt;th&gt;Check&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Fix gone after a kernel update&lt;/td&gt;
      &lt;td&gt;Node-local, never baked&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;findmnt --target&lt;/code&gt; before changing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Baked and verified, node still wrong&lt;/td&gt;
      &lt;td&gt;Node has a per-node image override&lt;/td&gt;
      &lt;td&gt;resolve per node, not per category&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Change appeared on unrelated nodes&lt;/td&gt;
      &lt;td&gt;Image shared across classes&lt;/td&gt;
      &lt;td&gt;list devices per image before writing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Node boots with old and new config&lt;/td&gt;
      &lt;td&gt;Leftover file in a drop-in dir in the image&lt;/td&gt;
      &lt;td&gt;count files in the directory&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Works on one cluster, not the other&lt;/td&gt;
      &lt;td&gt;Same path, local on one, shared on the other&lt;/td&gt;
      &lt;td&gt;compare &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;findmnt&lt;/code&gt; output&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Image file present, no effect&lt;/td&gt;
      &lt;td&gt;Wrong path inside the tree, or wrong mode&lt;/td&gt;
      &lt;td&gt;assert content and mode from the image&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Before closing the repair, check the copy that the next rebuild will read. A correct file on today’s running node will not survive if the provisioning source still contains the old version.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>PowerScale and Isilon for AI and HPC: designing the data path</title>
    <link href="https://www.wirewalk.com/writing/powerscale-isilon-ai-hpc-storage-design/"/>
    <published>2026-08-15T00:00:00-04:00</published>
    <updated>2026-10-18T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/powerscale-isilon-ai-hpc-storage-design/</id>
    <summary>Design Dell PowerScale and Isilon storage for AI and HPC pipelines: map client access, dataset layout, compute placement, capacity, and recovery requirements.</summary>
    <content type="html">&lt;p&gt;Instrument ingest, training reads and a shared analysis workspace may all use one PowerScale namespace, but they create different storage loads. Size the system around those operations and their overlap, including what happens during recovery.&lt;/p&gt;

&lt;p&gt;The questions below help prepare a design and its workload tests. Use the installed OneFS release’s compatibility and sizing guidance when choosing node models and supported configurations.&lt;/p&gt;

&lt;h2 id=&quot;map-the-pipeline-before-sizing-storage&quot;&gt;Map the pipeline before sizing storage&lt;/h2&gt;

&lt;p&gt;Draw the full path: acquisition, landing area, validation, preprocessing, training, checkpoints, analysis and retained results. For each stage record file sizes, file counts, concurrency, read/write mix and the time available to complete the work.&lt;/p&gt;

&lt;p&gt;Separate the dataset’s retained capacity from its active working set. A large repository does not mean every byte must support peak training throughput simultaneously. Equally, a modest dataset with heavy random access may need more service capacity than its size suggests.&lt;/p&gt;

&lt;p&gt;Give each stage an acceptance metric: ingest completed within its collection window, preprocessing samples per second, training batch-wait latency, or checkpoint restore time. These are more useful design inputs than an isolated sequential read target.&lt;/p&gt;

&lt;h2 id=&quot;treat-the-client-connection-path-as-part-of-the-system&quot;&gt;Treat the client connection path as part of the system&lt;/h2&gt;

&lt;p&gt;Dell documents &lt;a href=&quot;https://infohub.delltechnologies.com/en-us/l/dell-powerscale-onefs-nfs-design-considerations-and-best-practices/smartconnect-154/&quot;&gt;SmartConnect client distribution&lt;/a&gt; as part of its NFS design guidance. Design and validate DNS, client access networks and connection distribution together. Do not assume that pointing every client at one hostname proves balanced use of all available nodes.&lt;/p&gt;

&lt;p&gt;For the intended Linux clients, record protocol version, mount options, source networks and resolved endpoints. Confirm supported configurations against the relevant release documentation. Measure real client behavior under load before changing defaults.&lt;/p&gt;

&lt;p&gt;Test the path from the compute allocation itself. A login-node transfer exercises different CPU, network and concurrency conditions from a multi-node training job. Access that works from an administrator’s workstation also says little about the research user’s effective identity on a compute node.&lt;/p&gt;

&lt;h2 id=&quot;keep-dataset-shape-visible&quot;&gt;Keep dataset shape visible&lt;/h2&gt;

&lt;p&gt;A pipeline opening millions of individual samples can spend substantial time handling metadata and decoding. A large-file read test will not expose that cost. Compare original and sharded representations with equivalent samples, randomization and transform behavior.&lt;/p&gt;

&lt;p&gt;Where node-local staging is useful, define who creates the staged copy, verifies completeness, authorizes access and removes it. Include staging time in job completion measurements. Avoid an unmanaged second repository whose lineage and permissions drift from the shared source.&lt;/p&gt;

&lt;p&gt;For GPU training, measure loader wait and useful samples or tokens per second. If a prepared in-memory batch is still slow, storage is unlikely to be the first component to fix.&lt;/p&gt;

&lt;h2 id=&quot;plan-pools-and-capacity-with-operational-headroom&quot;&gt;Plan pools and capacity with operational headroom&lt;/h2&gt;

&lt;p&gt;OneFS &lt;a href=&quot;https://www.dell.com/support/manuals/en-us/isilon-onefs/ifs_pub_91500_administration_guide_gui/storage-pool-functions?guid=guid-3f5e71b8-bd0a-4450-b879-a92dd69846c3&amp;amp;lang=en-us&quot;&gt;storage pool functions&lt;/a&gt; depend on compatible node groupings and licensed capabilities. Verify these against the specific cluster rather than treating every node addition as interchangeable capacity.&lt;/p&gt;

&lt;p&gt;Track retained datasets, checkpoints, snapshots, temporary processing output and expected growth separately. Ask how protection work, maintenance and a component failure change the resources available to foreground jobs. Agree on usable operating headroom with the platform’s supported guidance; a generic utilization percentage is not a universal policy.&lt;/p&gt;

&lt;h2 id=&quot;make-identity-and-recovery-design-inputs&quot;&gt;Make identity and recovery design inputs&lt;/h2&gt;

&lt;p&gt;A shared namespace does not remove the need for project boundaries. Document Linux identities, export restrictions, administrative roles and any multiprotocol mappings. Validate access as the actual user and test both allowed and denied operations.&lt;/p&gt;

&lt;p&gt;Define which data is reproducible, which must be retained, and which needs an independent recovery copy. Restoring a namespace and restoring a working training pipeline are different exercises. Include metadata, permissions and software/data lineage in the recovery test.&lt;/p&gt;

&lt;h2 id=&quot;accept-the-system-with-representative-workloads&quot;&gt;Accept the system with representative workloads&lt;/h2&gt;

&lt;p&gt;Run a small matrix covering ingestion, concurrent training reads, checkpoint writes and metadata-heavy analysis. Repeat with realistic background activity. Capture both aggregate throughput and the slowest client’s latency, with versions, connection distribution and dataset layout attached.&lt;/p&gt;

&lt;p&gt;Keep these results as the baseline for growth planning. When more capacity is proposed, identify which workload constraint the purchase is expected to relieve.&lt;/p&gt;

&lt;p&gt;Continue with &lt;a href=&quot;/writing/powerscale-isilon-nfs-performance-troubleshooting/&quot;&gt;PowerScale performance diagnosis&lt;/a&gt;, &lt;a href=&quot;/writing/pytorch-dataloader-bottlenecks-hpc-gpu-training/&quot;&gt;PyTorch input pipelines&lt;/a&gt;, and &lt;a href=&quot;/writing/powerscale-multiprotocol-identity-acls/&quot;&gt;multiprotocol identity and ACLs&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lustre client evictions: preserve the timeline before resetting the node</title>
    <link href="https://www.wirewalk.com/writing/lustre-client-eviction-recovery-evidence/"/>
    <published>2026-08-13T10:00:00-04:00</published>
    <updated>2026-08-13T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/lustre-client-eviction-recovery-evidence/</id>
    <summary>Investigate Lustre client evictions using client, server and network timelines, then validate application recovery before returning affected nodes to service.</summary>
    <content type="html">&lt;p&gt;A client eviction message is an event to explain, not a complete diagnosis. Restarting the client may restore access while erasing the timing and process state needed to determine why it stopped responding appropriately.&lt;/p&gt;

&lt;p&gt;Lustre recovery protects the filesystem’s coordinated state. That does not mean every application on an affected client can continue as if nothing happened. Investigation has to cover both the filesystem protocol and the research processes that were waiting on it.&lt;/p&gt;

&lt;p&gt;Use the operations guidance for the installed Lustre release and storage product. Managed services and vendor appliances can restrict which observations or recovery actions are available. The workflow below starts with evidence and avoids changing timeout policy as a first response.&lt;/p&gt;

&lt;h2 id=&quot;establish-the-extent-of-the-incident&quot;&gt;Establish the extent of the incident&lt;/h2&gt;

&lt;p&gt;Record when the first affected job stopped making progress, which clients reported errors and which storage targets were involved. Distinguish an isolated client from a rack, network path or filesystem-wide event.&lt;/p&gt;

&lt;p&gt;Check whether unaffected clients can perform a small authorized operation on the same service. Use a designated test location rather than an active research directory. A single successful read from cache is weak evidence of service health, so choose an observation that actually exercises the relevant path.&lt;/p&gt;

&lt;p&gt;Ask what changed just before the event: maintenance, link flaps, a client kernel update, an unusually large workload or a server transition. These are leads for correlation. A recent change is not automatically the cause.&lt;/p&gt;

&lt;h2 id=&quot;collect-both-sides-of-the-conversation&quot;&gt;Collect both sides of the conversation&lt;/h2&gt;

&lt;p&gt;Retain client kernel messages and relevant service logs, with time zone and boot identity. On the server side, obtain corresponding target and recovery events through the supported administration interface. Preserve the original records before filtering them into a short incident summary.&lt;/p&gt;

&lt;p&gt;Read-only client observations can include:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;uname&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;
findmnt &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; lustre &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; TARGET,SOURCE,FSTYPE,OPTIONS
journalctl &lt;span class=&quot;nt&quot;&gt;-k&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--since&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;-30 minutes&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--no-pager&lt;/span&gt;
ps &lt;span class=&quot;nt&quot;&gt;-eo&lt;/span&gt; pid,ppid,stat,wchan:32,comm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Permissions and log availability vary. Process names and paths can contain sensitive information, so store evidence in the appropriate private incident location. A public report should use generic roles and remove user data.&lt;/p&gt;

&lt;p&gt;Capture network errors and counter deltas over the same interval where possible. A cumulative error total from weeks of operation cannot establish what happened during this eviction.&lt;/p&gt;

&lt;h2 id=&quot;understand-recovery-without-assuming-its-outcome&quot;&gt;Understand recovery without assuming its outcome&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://doc.lustre.org/lustre_manual.pdf&quot;&gt;Lustre 2.x operations manual&lt;/a&gt; describes filesystem recovery and client eviction. Use its model to interpret the target and client events in the installed release rather than treating every reconnect as a full recovery of every operation.&lt;/p&gt;

&lt;p&gt;Identify whether the event followed a server restart, a network interruption or a client that could not respond within the required protocol interval. Check what the server reports about recovery progress and which clients are still involved. Avoid generating additional load by repeatedly running expansive filesystem commands during a stressed recovery.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://wiki.lustre.org/Lustre_Resiliency%3A_Understanding_Lustre_Message_Loss_and_Tuning_for_Resiliency&quot;&gt;Lustre resiliency discussion&lt;/a&gt; explains why message handling and timeouts can matter. Keep timeout changes behind an identified failure mode and supported vendor guidance. Longer waits can hide a fault and extend application stalls without correcting it.&lt;/p&gt;

&lt;h2 id=&quot;inspect-the-client-as-a-whole-system&quot;&gt;Inspect the client as a whole system&lt;/h2&gt;

&lt;p&gt;A client unable to respond promptly may be suffering from CPU starvation, memory pressure, kernel problems or an unstable network. Look for contemporaneous evidence rather than choosing one explanation from the eviction message alone.&lt;/p&gt;

&lt;p&gt;Compare the failing client with a qualified peer using the same hardware and workload class. Check kernel, Lustre client and RDMA stack versions where applicable. Differences in the actual running stack matter more than an image label that two nodes happen to share.&lt;/p&gt;

&lt;p&gt;Review the workload’s concurrency and metadata behavior. A burst of operations can expose an existing bottleneck, but the application should not be blamed merely because it was busy. Establish which component delayed or failed and whether the behavior is reproducible in a bounded test.&lt;/p&gt;

&lt;h2 id=&quot;keep-affected-jobs-out-of-the-automatic-success-path&quot;&gt;Keep affected jobs out of the automatic success path&lt;/h2&gt;

&lt;p&gt;Mark the node unavailable to new allocations while its state is uncertain. Preserve the running jobs’ evidence and coordinate with owners before terminating processes or unmounting the filesystem. A process in an uninterruptible wait may not respond immediately to a signal.&lt;/p&gt;

&lt;p&gt;Check application logs for errors and incomplete output. A filesystem that is mounted again does not make a partially written checkpoint valid. Use the application’s completion and integrity rules to decide which artifacts can be retained and where the run must restart.&lt;/p&gt;

&lt;p&gt;Avoid an unbounded restart loop. If a node repeatedly rejoins and reproduces the same failure, keep it isolated and investigate. Repeated resets can amplify service load and make the original incident harder to reconstruct.&lt;/p&gt;

&lt;h2 id=&quot;recover-through-the-supported-procedure&quot;&gt;Recover through the supported procedure&lt;/h2&gt;

&lt;p&gt;Once evidence is preserved, use the recovery steps appropriate to the identified state. That may involve a client remount, reboot or vendor-directed action, but none should be selected solely because it worked on a previous incident with a similar last log line.&lt;/p&gt;

&lt;p&gt;Confirm that the planned action does not affect other clients or discard needed local state. Record its start and finish times. Keep a way to recover the node if it fails to return to ordinary management access.&lt;/p&gt;

&lt;p&gt;For a managed Lustre service, follow the provider’s documented client lifecycle and support path. Actions available on a self-managed target should not be assumed to exist on the managed service.&lt;/p&gt;

&lt;h2 id=&quot;admit-the-node-with-a-workload-level-check&quot;&gt;Admit the node with a workload-level check&lt;/h2&gt;

&lt;p&gt;Validate mount access, permissions, a bounded create/write/read/verify/remove cycle in a test directory and a scheduler-launched task as an ordinary user. Then run a representative small application or checkpoint reload that exercises the path involved in the incident.&lt;/p&gt;

&lt;p&gt;Watch the relevant logs and interval counters during the test. A successful command with new recovery warnings is not a clean acceptance result. Retain the outcome and the reason the node is considered ready.&lt;/p&gt;

&lt;p&gt;The incident record should connect the original symptom, supported cause, recovery action and evidence of usable output. For capacity problems that resemble an outage, see &lt;a href=&quot;/writing/lustre-metadata-capacity-performance-operations/&quot;&gt;Lustre metadata operations and performance&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>DNS and mail authentication: a TXT answer is not a valid policy</title>
    <link href="https://www.wirewalk.com/writing/dns-mail-authentication-audit/"/>
    <published>2026-08-13T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/dns-mail-authentication-audit/</id>
    <summary>Check record content, sender alignment, and real message headers before declaring mail authentication healthy.</summary>
    <content type="html">&lt;p&gt;Before trusting a mail-authentication check, inspect the returned DNS record. A wildcard or stale TXT entry can produce a nonempty answer at the wrong name. Follow the DNS inspection with an authorized message test and read the receiver’s authentication results.&lt;/p&gt;

&lt;h2 id=&quot;inspect-the-exact-names&quot;&gt;Inspect the exact names&lt;/h2&gt;

&lt;p&gt;For a domain you administer, replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;example.com&lt;/code&gt; and the known DKIM selector:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dig +short TXT example.com
dig +short TXT _dmarc.example.com
dig +short TXT selector1._domainkey.example.com
dig +short TXT deliberately-unused-label.example.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The last query helps identify a wildcard response. An answer identical to the apex TXT content at an unrelated name deserves investigation. Confirm against authoritative nameservers and parse the actual policy rather than accepting any nonempty answer.&lt;/p&gt;

&lt;h2 id=&quot;separate-the-mechanisms&quot;&gt;Separate the mechanisms&lt;/h2&gt;

&lt;p&gt;SPF authorizes sending infrastructure for the envelope identity. DKIM associates a cryptographic signature with a signing domain. DMARC evaluates alignment with the visible From domain and publishes handling/reporting policy. The primary specifications are &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc7208&quot;&gt;SPF, RFC 7208&lt;/a&gt;, &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc6376&quot;&gt;DKIM, RFC 6376&lt;/a&gt;, and &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc7489&quot;&gt;DMARC, RFC 7489&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Consult current provider guidance and subsequent standards updates when implementing. This article’s inspection method does not depend on copying a universal TXT record.&lt;/p&gt;

&lt;h2 id=&quot;inventory-legitimate-senders&quot;&gt;Inventory legitimate senders&lt;/h2&gt;

&lt;p&gt;List the primary mail provider, billing system, CRM, website forms, and any other service sending as the domain. Record the actual envelope and signing domains from message headers. A vendor’s generic setup page cannot establish which identity your account is currently using.&lt;/p&gt;

&lt;p&gt;Remove stale authorizations through a reviewed change after confirming they are no longer needed. Do not tighten policy blindly: an overlooked legitimate sender can be rejected along with unwanted mail.&lt;/p&gt;

&lt;h2 id=&quot;test-with-real-headers&quot;&gt;Test with real headers&lt;/h2&gt;

&lt;p&gt;Send an approved test message from each legitimate route to a controlled mailbox. Inspect Authentication-Results, the visible From address, envelope identity, and DKIM signing domain. Confirm alignment and final delivery.&lt;/p&gt;

&lt;p&gt;A website form displaying a thank-you message does not prove it sent mail. Verify that the receiving mailbox actually contains the message and that the sender identity is what the design intended.&lt;/p&gt;

&lt;h2 id=&quot;roll-policy-out-with-evidence&quot;&gt;Roll policy out with evidence&lt;/h2&gt;

&lt;p&gt;Begin with an inventory and reporting workflow, review legitimate failures, and adopt stricter handling according to the organization’s risk decision. Retain an explicit rollback and propagation plan. DNS caching means different receivers can observe different states during a change.&lt;/p&gt;

&lt;h2 id=&quot;keep-checks-semantic&quot;&gt;Keep checks semantic&lt;/h2&gt;

&lt;p&gt;The automated check should validate policy syntax, uniqueness where required, record type, and the relationship between DNS and observed message authentication. It should report lookup errors as incomplete evidence, not absence or success.&lt;/p&gt;

&lt;p&gt;Repeat after adding a SaaS sender, changing mail providers, or replacing the website’s form handler. Each of those changes can add a new sender or alter the authentication path.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>OSU Micro-Benchmarks: measuring the fabric before you blame the application</title>
    <link href="https://www.wirewalk.com/writing/osu-micro-benchmarks/"/>
    <published>2026-08-12T00:00:00-04:00</published>
    <updated>2026-08-12T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/osu-micro-benchmarks/</id>
    <summary>Point-to-point latency and bandwidth are the first numbers to establish on a new cluster, because every distributed result you collect afterwards is built on top of them.</summary>
    <content type="html">&lt;p&gt;When a distributed job slows down, a saved OSU Micro-Benchmarks result can settle whether communication has changed. These small MPI programs from the MVAPICH group at Ohio State measure individual communication patterns without the application’s compute and I/O work.&lt;/p&gt;

&lt;p&gt;Run them while the machine is known to be healthy and keep the curves. During an incident, use the same placement and software stack to compare the new result with that baseline.&lt;/p&gt;

&lt;h2 id=&quot;the-two-that-matter-most&quot;&gt;The two that matter most&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_latency&lt;/code&gt; sends a message between two ranks and reports half the round trip
time. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; streams a window of messages in one direction and reports
sustained bandwidth. Everything else in the suite is a variation on those two
ideas.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# two ranks, one per node, pinned&lt;/span&gt;
mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:1:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ./osu_latency
mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:1:node &lt;span class=&quot;nt&quot;&gt;--bind-to&lt;/span&gt; core &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ./osu_bw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Both sweep message sizes and print a table. Read them as two different regimes.
Small messages measure the fixed cost of getting a message onto the wire and
back off it: software stack, doorbell, interrupt or polling behavior, and the
switch hop count. Large messages measure how much of the link you can actually
fill. The interesting part is the middle, where the transport switches protocol.&lt;/p&gt;

&lt;h2 id=&quot;the-eager-to-rendezvous-transition&quot;&gt;The eager to rendezvous transition&lt;/h2&gt;

&lt;p&gt;Below a threshold, MPI implementations send small messages eagerly: the sender
pushes the payload without waiting to hear that the receiver has somewhere to
put it. Above the threshold they switch to rendezvous, where the sender first
exchanges control messages and then the data moves by RDMA directly into the
destination buffer.&lt;/p&gt;

&lt;p&gt;You can see the switch in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_bw&lt;/code&gt; table as a visible discontinuity in the
bandwidth curve. Knowing where it sits on your system is genuinely useful,
because an application whose typical message size lands just above the threshold
will behave very differently from one that lands just below. Both MPICH-derived
and Open MPI stacks let you move that threshold; whether you should is a
question to answer with measurements from your own application, not from a
micro-benchmark.&lt;/p&gt;

&lt;h2 id=&quot;pinning-changes-the-answer&quot;&gt;Pinning changes the answer&lt;/h2&gt;

&lt;p&gt;An unpinned two-rank latency test measures the scheduler as much as the network.
If the process migrates to a core on the socket that does not own the HCA, every
message crosses the inter-socket link on the way to the wire.&lt;/p&gt;

&lt;p&gt;Always pin, always place one rank per node for the point-to-point tests, and
check which NUMA domain your adapter is attached to:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/infiniband/mlx5_0/device/numa_node
lstopo &lt;span class=&quot;nt&quot;&gt;--output-format&lt;/span&gt; txt | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-40&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If that returns a socket your ranks are not running on, fix the placement before
recording anything. This single mistake accounts for a large share of “the
network is slow” reports that turn out not to involve the network.&lt;/p&gt;

&lt;h2 id=&quot;collectives-and-why-they-are-a-different-question&quot;&gt;Collectives, and why they are a different question&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_allreduce&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_alltoall&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osu_barrier&lt;/code&gt; scale to the full job size and
are much closer to what real applications do. They are also much more sensitive
to noise. One slow node, one core running a stray daemon, one rank waiting on a
filesystem, and the whole collective inherits the delay, because a collective
finishes when its slowest participant finishes.&lt;/p&gt;

&lt;p&gt;That sensitivity is the point. A collective benchmark that degrades while
point-to-point stays clean is telling you the problem is not the fabric. It is
jitter, and jitter comes from the operating system, the scheduler, thermal
behavior or a filesystem mount, not from the switch.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Run the point-to-point tests between several different node pairs, not just the
first two the scheduler hands you. A single bad cable or a port that negotiated
a lower width will only show up when that specific link is on the path, and it
will look like an application problem for weeks.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;gpu-buffers&quot;&gt;GPU buffers&lt;/h2&gt;

&lt;p&gt;Recent versions build CUDA-aware variants that take &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-d cuda&lt;/code&gt;, which places the
send and receive buffers in device memory instead of host memory:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 2 &lt;span class=&quot;nt&quot;&gt;-map-by&lt;/span&gt; ppr:1:node ./osu_bw &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; cuda D D
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is worth measuring separately, because the path is different. With
GPUDirect RDMA working, the adapter reads and writes device memory directly.
Without it, every message takes a detour through a host bounce buffer, and you
will see it immediately in the bandwidth number. Comparing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-d cuda&lt;/code&gt; against the
host-memory run is the fastest way to confirm GPUDirect is actually engaged
rather than merely installed.&lt;/p&gt;

&lt;h2 id=&quot;what-to-record&quot;&gt;What to record&lt;/h2&gt;

&lt;p&gt;Keep a file in version control with the date, the firmware and driver versions,
the MPI build, the node pair, and the resulting curves. That gives the next investigation a concrete comparison, with the node pair and software versions already recorded.&lt;/p&gt;

&lt;p&gt;The next articles in this series work up the stack from here: dense compute with
HPL, memory and network behavior with HPCG, mixed precision with HPL-MxP, and
collectives on GPU clusters with nccl-tests. All of them are easier to interpret
once you know what a single link on your machine can do.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Nine ways an environment module makes working software look broken</title>
    <link href="https://www.wirewalk.com/writing/environment-modules-failure-modes/"/>
    <published>2026-07-29T10:00:00-04:00</published>
    <updated>2026-07-29T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/environment-modules-failure-modes/</id>
    <summary>The environment module system fails quietly by design, and almost every one of its failures presents as missing or broken software. This walks through nine mechanisms, the command that distinguishes each from the others, and a verification harness that loads every module in a clean shell and runs it.</summary>
    <content type="html">&lt;p&gt;A user reports a tool is broken. You load the module, run the tool, and it works. The user runs
the same three lines and it does not. Nothing in either transcript looks wrong.&lt;/p&gt;

&lt;p&gt;That shape of report is almost always the module system, not the software, and it costs so much
time because environment modules fail silently by construction. A modulefile sets variables.
Setting one to a directory that does not exist is not an error. Forgetting the matching &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt;
entry is not an error. Loading a module whose files were deleted six months ago is not an error.
The module system reports success in all three cases, and the failure surfaces elsewhere — as
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;command not found&lt;/code&gt;, a missing Python package, or a linker error naming an unfamiliar symbol
version.&lt;/p&gt;

&lt;p&gt;The nine cases below each have a distinguishing check. The final harness combines several of those checks so a broken module can be found before a user submits work with it.&lt;/p&gt;

&lt;h2 id=&quot;what-module-actually-is&quot;&gt;What &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module&lt;/code&gt; actually is&lt;/h2&gt;

&lt;p&gt;Everything here follows from one fact. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module&lt;/code&gt; is not a program. It is a shell function that runs
a program, captures the shell code it prints, and evaluates that in your current shell. Lmod
defines it around &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$LMOD_CMD&lt;/code&gt;, Tcl Environment Modules around &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;modulecmd&lt;/code&gt;. Watch it work:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ $LMOD_CMD bash load gcc/12.3.0 2&amp;gt;/dev/null
PATH=/opt/apps/gcc/12.3.0/bin:/usr/local/bin:/usr/bin:/bin; export PATH;
LD_LIBRARY_PATH=/opt/apps/gcc/12.3.0/lib64; export LD_LIBRARY_PATH;
LOADEDMODULES=gcc/12.3.0; export LOADEDMODULES;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is the shape of it, abridged: a real Lmod run also emits &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_LMFILES_&lt;/code&gt;, reference counts and
its serialized module table, which is noise for this purpose but worth seeing once.&lt;/p&gt;

&lt;p&gt;Two consequences follow. First, the effect of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module load&lt;/code&gt; is confined to the shell that ran the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eval&lt;/code&gt;; put it anywhere the shell forks and it lands in a child that exits immediately. Second,
the shell code has to have stdout to itself, so diagnostics go somewhere else — and where they go
depends on which implementation you have. Lmod writes the output of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module avail&lt;/code&gt;
and friends to stderr by default; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LMOD_REDIRECT=yes&lt;/code&gt; (or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--redirect&lt;/code&gt;) moves it to stdout, and the
Lmod documentation notes that only works for bash and zsh, not csh or tcsh. Tcl Environment Modules
went the other way: current releases document a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;redirect_output&lt;/code&gt; configuration option that
defaults to on, so on sh, bash, ksh, zsh and fish the messages arrive on stdout unless someone
passes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--no-redirect&lt;/code&gt;. Check yours with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module config&lt;/code&gt; rather than assuming either default.&lt;/p&gt;

&lt;p&gt;The practical consequence is that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list | grep&lt;/code&gt; works on one of your clusters and silently
returns nothing on the other, and the reader concludes the module is not loaded. Redirect
explicitly and the question does not arise:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module list | grep -c gcc      # 0 under Lmod&apos;s default, 1 under Modules&apos; default
$ module list 2&amp;gt;&amp;amp;1 | grep -c gcc # 1 under both
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For anything you intend to parse rather than read, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module -t list&lt;/code&gt; (terse) is a better input than
the decorated human output.&lt;/p&gt;

&lt;h2 id=&quot;1-a-load-inside-a-pipe-or-a-command-substitution-goes-nowhere&quot;&gt;1. A load inside a pipe or a command substitution goes nowhere&lt;/h2&gt;

&lt;p&gt;This is the one that costs hours, because every line of output looks correct.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cat wanted.txt | while read -r m; do module load &quot;$m&quot;; done
$ module list 2&amp;gt;&amp;amp;1
No modules loaded
$ samtools --version
bash: samtools: command not found
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;No error was printed and the loads succeeded. In bash each stage of a pipeline runs in a subshell,
so the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;while&lt;/code&gt; loop — and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eval&lt;/code&gt; inside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module&lt;/code&gt; — executed in a forked child. The child
exported the variables and exited. The parent shell was never touched. (Bash has one escape hatch
here, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shopt -s lastpipe&lt;/code&gt;, which runs the final stage in the current shell — but only when job
control is off, so it does nothing in an interactive session, which is exactly where people test
it.)&lt;/p&gt;

&lt;p&gt;The command substitution version is worse, because the inner answer is right:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ VER=$(module load python/3.11.6 &amp;amp;&amp;amp; python3 --version)
$ echo &quot;$VER&quot;
Python 3.11.6
$ python3 --version
Python 3.9.18
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The load did work — inside the subshell, where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3&lt;/code&gt; really was 3.11.6, which is why the
captured string looks like proof that the module is loaded. The parent shell has nothing loaded,
and the next line in the script is the one that fails.&lt;/p&gt;

&lt;p&gt;Two more places the fork is invisible: every recipe line in a makefile runs in its own shell, so
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module load&lt;/code&gt; on one line and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$(CC)&lt;/code&gt; on the next are unrelated environments, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xargs&lt;/code&gt; execs a
fresh process per batch. Over ssh without a login shell the function is often not defined at all.&lt;/p&gt;

&lt;p&gt;The fixes are mechanical — a process-substitution loop keeps the body in the current shell, make
wants &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;amp;&amp;amp;&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.ONESHELL:&lt;/code&gt;, and ssh wants the init script sourced explicitly.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ while read -r m; do module load &quot;$m&quot;; done &amp;lt; &amp;lt;(grep -v &apos;^#&apos; wanted.txt)
$ ssh node &apos;source /usr/share/lmod/lmod/init/bash &amp;amp;&amp;amp; module load gcc/12.3.0 &amp;amp;&amp;amp; gcc --version&apos;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The diagnostic that settles it in one line: after the load, print &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LOADEDMODULES&lt;/code&gt; in the shell you
care about. If it is empty there, the load happened somewhere else.&lt;/p&gt;

&lt;h2 id=&quot;2-which-says-one-thing-and-a-different-binary-runs&quot;&gt;2. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;which&lt;/code&gt; says one thing and a different binary runs&lt;/h2&gt;

&lt;p&gt;This is the section where the obvious reading is wrong twice — once about the symptom, and once
about the fix nearly everyone prescribes for it.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module load python/3.11.6
$ which python3
/opt/apps/python/3.11.6/bin/python3
$ python3 --version
Python 3.9.18
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The standard answer is that bash has cached the old location and you need &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hash -r&lt;/code&gt;. Test that
before believing it, because in bash it is not what happened:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mkdir -p /tmp/ht/a /tmp/ht/b
$ printf &apos;#!/bin/sh\necho A\n&apos; &amp;gt; /tmp/ht/a/foo
$ printf &apos;#!/bin/sh\necho B\n&apos; &amp;gt; /tmp/ht/b/foo
$ chmod +x /tmp/ht/a/foo /tmp/ht/b/foo
$ PATH=/tmp/ht/a:$PATH
$ foo                                        # runs, and is now hashed
A
$ eval &apos;PATH=/tmp/ht/b:$PATH; export PATH;&apos;  # exactly what module load evaluates
$ foo
B
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Assigning to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; makes bash discard every remembered location — plainly, with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;export&lt;/code&gt;, from
inside a function, or inside the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eval&lt;/code&gt; that the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module&lt;/code&gt; function runs. All four behave the same
way on the bash used for the transcripts here (3.2.57); the test above takes two minutes on
whatever bash your cluster actually runs, and is worth doing before you accept either account. zsh
behaves the same, and tcsh rebuilds its hash when &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;path&lt;/code&gt; is set. A module load &lt;em&gt;is&lt;/em&gt; a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt;
assignment, so it cannot leave a stale entry behind, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hash -r&lt;/code&gt; after &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module load&lt;/code&gt; is a ritual
aimed at a failure bash does not have. Prescribing it costs you the one thing you were short of: a
reason to look somewhere else.&lt;/p&gt;

&lt;p&gt;Two things &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;which&lt;/code&gt; genuinely cannot see, and one that it can.&lt;/p&gt;

&lt;p&gt;A function or an alias beats &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; outright, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;which&lt;/code&gt; is an external program that knows only
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt;. Sites wrap interpreters this way, users copy the wrapper into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module&lt;/code&gt;
itself is a shell function, so nothing here is exotic:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ type python3
python3 is a function
python3 () 
{ 
    /usr/bin/python3 &quot;$@&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is what the transcript at the top of this section really was: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; changed exactly as asked,
and a function defined in a site profile went on answering to the name.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;command python3 --version&lt;/code&gt; bypasses it for one call, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unset -f python3&lt;/code&gt; for the session. Note that
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;command -v python3&lt;/code&gt; prints just &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3&lt;/code&gt; for a function — correct, and useless as evidence.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type&lt;/code&gt; is the builtin to reach for. Aliases produce the same symptom interactively and then
disappear in batch, because bash does not expand aliases in non-interactive shells unless
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;expand_aliases&lt;/code&gt; is set: that is the “works in my shell, fails in my job script” report.&lt;/p&gt;

&lt;p&gt;The hash cache is real, but its trigger is the opposite of the folklore — it bites when &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; does
&lt;em&gt;not&lt;/em&gt; change and a same-named binary appears earlier on it. A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pip install --user&lt;/code&gt; into
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.local/bin&lt;/code&gt;, a wrapper dropped into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/local/bin&lt;/code&gt;, an install finishing while the user’s shell
is open:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ PATH=/tmp/ht/a:/tmp/ht/b:$PATH        # a is earlier and has no bar yet
$ cp /tmp/ht/b/foo /tmp/ht/b/bar; bar
B
$ cp /tmp/ht/a/foo /tmp/ht/a/bar        # an earlier bar now exists; PATH unchanged
$ which bar
/tmp/ht/a/bar
$ type bar
bar is hashed (/tmp/ht/b/bar)
$ bar
B
$ hash -r; bar
A
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One detail worth knowing before you rely on the diagnostic: on the bash tested here, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type -a bar&lt;/code&gt;
re-searched &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; and listed both directories without mentioning the cache at all, while plain
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type bar&lt;/code&gt; named it. Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type&lt;/code&gt; without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-a&lt;/code&gt;, or the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hash&lt;/code&gt; builtin, which prints the table with hit
counts. In tcsh the equivalent situation needs &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rehash&lt;/code&gt;, and there &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;which&lt;/code&gt; is a builtin that
consults the same cache, so it agrees with the wrong answer rather than contradicting it.&lt;/p&gt;

&lt;h2 id=&quot;3-the-module-that-sets-a-variable-but-no-interpreter&quot;&gt;3. The module that sets a variable but no interpreter&lt;/h2&gt;

&lt;p&gt;A common pattern for Python tooling is a modulefile pointing at a virtual environment:&lt;/p&gt;

&lt;div class=&quot;language-tcl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;setenv    TOOLKIT_VENV  /shared/apps/toolkit/1.4/venv
setenv    PYTHONPATH    /shared/apps/toolkit/1.4/venv/lib/python3.11/site-packages
prepend-path PATH       /shared/apps/toolkit/1.4/bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The user does the obvious check and gets a genuinely misleading answer:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module load toolkit/1.4
$ python3 -c &quot;import toolkit&quot;
Traceback (most recent call last):
  File &quot;&amp;lt;string&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;
ModuleNotFoundError: No module named &apos;toolkit&apos;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The package is installed, under an interpreter that is not on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt;. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3&lt;/code&gt; here is still the
system 3.9, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PYTHONPATH&lt;/code&gt; has pointed it at a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;site-packages&lt;/code&gt; built for 3.11 — so on top of the
version mismatch, any compiled extension there is named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_core.cpython-311-x86_64-linux-gnu.so&lt;/code&gt;
and 3.9 will not look at it.&lt;/p&gt;

&lt;p&gt;Ask the interpreter where it is, not whether the import worked:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ python3 -c &quot;import sys; print(sys.executable); print(sys.version_info[:2])&quot;
/usr/bin/python3
(3, 9)
$ &quot;$TOOLKIT_VENV/bin/python&quot; -c &quot;import toolkit; print(toolkit.__version__)&quot;
1.4.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is the diagnosis. The fix is to put the venv’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bin&lt;/code&gt; on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; and stop setting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PYTHONPATH&lt;/code&gt;
— a venv does not need it, and setting it turns a clean “wrong interpreter” failure into a
confusing “half the packages import” one.&lt;/p&gt;

&lt;div class=&quot;language-tcl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;prepend-path PATH  /shared/apps/toolkit/1.4/venv/bin
unsetenv     PYTHONPATH
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PYTHONPATH&lt;/code&gt; deserves a blanket rule: a shared modulefile should never set it. Its entries are
searched ahead of the interpreter’s own standard library and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;site-packages&lt;/code&gt; — everything except
the script’s own directory — and they leak into every unrelated Python process started from that
session, including ones belonging to other modules.&lt;/p&gt;

&lt;h2 id=&quot;4-the-module-that-does-put-an-interpreter-on-the-path-and-shadows-everything&quot;&gt;4. The module that does put an interpreter on the path, and shadows everything&lt;/h2&gt;

&lt;p&gt;The opposite failure is quieter and lasts longer. A module that prepends a Python to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; has
changed the meaning of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3&lt;/code&gt; for everything else in that shell. Usually that is wanted. The
parts that are not:&lt;/p&gt;

&lt;p&gt;a script with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#!/usr/bin/env python3&lt;/code&gt; now runs under the module’s interpreter regardless of what
it was tested against; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pip install --user&lt;/code&gt; writes into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.local/lib/python3.11/&lt;/code&gt;, which then
becomes visible to every &lt;em&gt;other&lt;/em&gt; 3.11 on the system; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3 -m venv&lt;/code&gt; creates an environment
whose &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pyvenv.cfg&lt;/code&gt; records the module’s interpreter, and that venv keeps working right up until
the module directory is deleted.&lt;/p&gt;

&lt;p&gt;Load order decides the winner, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list&lt;/code&gt; will not tell you who won. Ask for the
resolution:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module load toolA toolB
$ type -a python3 | head -3
python3 is /opt/apps/toolB/2.1/bin/python3
python3 is /opt/apps/toolA/1.9/bin/python3
python3 is /usr/bin/python3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The structural fix is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;family&lt;/code&gt;. Lmod’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;family(&quot;python&quot;)&lt;/code&gt; makes modules in the same family
mutually exclusive, so the second load swaps the first rather than shadowing it:&lt;/p&gt;

&lt;div class=&quot;language-lua highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;python&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;prepend_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;PATH&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/opt/apps/python/3.11.6/bin&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module load python/3.11.6 python/3.12.2
Lmod is automatically replacing &quot;python/3.11.6&quot; with &quot;python/3.12.2&quot;.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That message is the point. The load still succeeds, but the user now knows.&lt;/p&gt;

&lt;p&gt;For application modules the better pattern is not to expose an interpreter at all: ship wrappers
in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bin/&lt;/code&gt; with an absolute shebang pointing at the venv’s Python, and put only that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bin&lt;/code&gt; on
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt;. The tool works; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3&lt;/code&gt; keeps meaning what it meant.&lt;/p&gt;

&lt;h2 id=&quot;5-several-modules-in-one-command&quot;&gt;5. Several modules in one command&lt;/h2&gt;

&lt;p&gt;A recurring ticket: loading modules one per line works, loading them in a single command fails,
and the user is told to stop doing the thing that failed without anyone explaining why.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module purge
$ module load compiler/gcc-12.3.0 mpi/openmpi-5.0.3 app/solver-4.2
$ solver --version
solver: error while loading shared libraries: libmpi.so.40: cannot open shared object file: No such file or directory
$ module purge
$ module load compiler/gcc-12.3.0
$ module load mpi/openmpi-5.0.3
$ module load app/solver-4.2
$ solver --version
solver 4.2.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two mechanisms are in play, and neither is as simple as it is usually told — including in the
direction most people assume.&lt;/p&gt;

&lt;p&gt;The first is that what a child process launched from a modulefile sees is an implementation
detail, not the environment the user will end up with, and the two implementations differ. Tcl
Environment Modules documents that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;setenv&lt;/code&gt; “will also change the process’ environment” and that it
“is useful for changing the environment prior to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exec&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;system&lt;/code&gt; command” — so there, a
value set by an earlier sibling in the same command &lt;em&gt;is&lt;/em&gt; visible to an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exec&lt;/code&gt; in a later one. Lmod
assembles the new environment internally and emits it at the end, and its two ways of running a
command differ on exactly this point: the documentation for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;capture()&lt;/code&gt; says it uses the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LD_PRELOAD&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LD_LIBRARY_PATH&lt;/code&gt; values that were current when Lmod was configured, and directs
you to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;subprocess()&lt;/code&gt; if you want the values in force now. So a modulefile doing this:&lt;/p&gt;

&lt;div class=&quot;language-tcl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;set mpiroot $env&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;MPI_ROOT&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
set mpiver  &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;exec $mpiroot/bin/mpirun --version&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;can behave one way on the cluster running Modules, another on the cluster running Lmod, and a
third way when the module that sets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MPI_ROOT&lt;/code&gt; is loaded in a separate command rather than as a
sibling — reading the modulefile tells you nothing about which. The same applies to any
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[file exists $env(SOMETHING)/...]&lt;/code&gt; test fed by a sibling.&lt;/p&gt;

&lt;p&gt;The second: whether prerequisite checks and hierarchical &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MODULEPATH&lt;/code&gt; additions are
honored within a single command varies across Tcl Environment Modules 3.2, 4.x and 5.x and across
Lmod 6 through 9. I am not going to give a version table I cannot stand behind. You can settle it
for your own stack in about thirty seconds:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module purge
$ module load compiler/gcc-12.3.0 mpi/openmpi-5.0.3; echo &quot;exit=$?&quot;
$ module list 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list&lt;/code&gt; shows fewer modules than you asked for while &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exit=0&lt;/code&gt;, your implementation loads
partially and does not report it. Know that before building automation on top of it.&lt;/p&gt;

&lt;p&gt;Two rules fall out regardless of version. In scripts, load one module per command and check the
result by inspecting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LOADEDMODULES&lt;/code&gt; rather than trusting the exit status. And never write a
modulefile that runs an external command at load time; compute the value at install time and
hard-code it.&lt;/p&gt;

&lt;h2 id=&quot;6-class-file-version-610-and-what-the-numbers-mean&quot;&gt;6. Class file version 61.0, and what the numbers mean&lt;/h2&gt;

&lt;p&gt;A Java tool that was built elsewhere produces this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module load gatk/4.5.0.0
$ gatk --version
Error: LinkageError occurred while loading main class org.broadinstitute.hellbender.Main
	java.lang.UnsupportedClassVersionError: org/broadinstitute/hellbender/Main has been
	compiled by a more recent version of the Java Runtime (class file version 61.0),
	this version of the Java Runtime only recognizes class file versions up to 52.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The message names two numbers and explains neither. They are class file format major versions, not
Java versions, and for Java 5 onward &lt;strong&gt;major version = Java release + 44&lt;/strong&gt;. So 61 is Java 17 and
52 is Java 8: the tool needs 17 and the node’s default is 8.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Class file major&lt;/th&gt;
      &lt;th&gt;Java release&lt;/th&gt;
      &lt;th&gt;Class file major&lt;/th&gt;
      &lt;th&gt;Java release&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;49&lt;/td&gt;
      &lt;td&gt;5&lt;/td&gt;
      &lt;td&gt;60&lt;/td&gt;
      &lt;td&gt;16&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;50&lt;/td&gt;
      &lt;td&gt;6&lt;/td&gt;
      &lt;td&gt;61&lt;/td&gt;
      &lt;td&gt;17&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;51&lt;/td&gt;
      &lt;td&gt;7&lt;/td&gt;
      &lt;td&gt;62&lt;/td&gt;
      &lt;td&gt;18&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;52&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;63&lt;/td&gt;
      &lt;td&gt;19&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;53&lt;/td&gt;
      &lt;td&gt;9&lt;/td&gt;
      &lt;td&gt;64&lt;/td&gt;
      &lt;td&gt;20&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;54&lt;/td&gt;
      &lt;td&gt;10&lt;/td&gt;
      &lt;td&gt;65&lt;/td&gt;
      &lt;td&gt;21&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;55&lt;/td&gt;
      &lt;td&gt;11&lt;/td&gt;
      &lt;td&gt;66&lt;/td&gt;
      &lt;td&gt;22&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;56&lt;/td&gt;
      &lt;td&gt;12&lt;/td&gt;
      &lt;td&gt;67&lt;/td&gt;
      &lt;td&gt;23&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;57&lt;/td&gt;
      &lt;td&gt;13&lt;/td&gt;
      &lt;td&gt;68&lt;/td&gt;
      &lt;td&gt;24&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;58&lt;/td&gt;
      &lt;td&gt;14&lt;/td&gt;
      &lt;td&gt;69&lt;/td&gt;
      &lt;td&gt;25&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;59&lt;/td&gt;
      &lt;td&gt;15&lt;/td&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt; &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Below that, 45 is Java 1.1 through 48 for 1.4. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.0&lt;/code&gt; after the major is the minor version; it
is zero except for preview features, where it is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;65535&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You do not need the table if you read the bytes. A class file is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CAFEBABE&lt;/code&gt;, a two-byte minor at
offset 4, then a two-byte major at offset 6, big-endian:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ unzip -p gatk.jar org/broadinstitute/hellbender/Main.class \
    | od -An -tu2 --endian=big -j6 -N2
  61
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--endian&lt;/code&gt; is a GNU coreutils option; on a box without it, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;od -An -tx1 -j6 -N2&lt;/code&gt; and read the two
bytes by hand.)&lt;/p&gt;

&lt;p&gt;Or, if a JDK is to hand:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ javap -verbose -cp gatk.jar org.broadinstitute.hellbender.Main | grep -E &apos;major|minor&apos;
  minor version: 0
  major version: 61
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The manifest often records the build JDK (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Build-Jdk-Spec: 17&lt;/code&gt;), which is a useful cross-check but
is not authoritative — it reflects the compiler, not the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--release&lt;/code&gt; target.&lt;/p&gt;

&lt;p&gt;One wrinkle before you conclude anything from a single class: a multi-release jar carries extra
copies under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;META-INF/versions/N/&lt;/code&gt; that are deliberately compiled for higher majors than the
jar’s baseline. If &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Multi-Release: true&lt;/code&gt; is in the manifest, check a class from the root of the
jar instead.&lt;/p&gt;

&lt;p&gt;The fix is a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;prereq&lt;/code&gt; in the modulefile, so the tool cannot load without its runtime — not a wiki
line telling people to load Java first:&lt;/p&gt;

&lt;div class=&quot;language-tcl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;prereq java/17
setenv JAVA_HOME /opt/apps/java/17.0.9
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;7-the-modulefile-that-loads-cleanly-and-sets-a-variable-to-nothing&quot;&gt;7. The modulefile that loads cleanly and sets a variable to nothing&lt;/h2&gt;

&lt;p&gt;Modulefiles get copied between clusters. The copy succeeds, the load succeeds, the software is not
there.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module load fsl/6.0.7
$ echo &quot;FSLDIR=$FSLDIR&quot;
FSLDIR=/opt/apps/fsl/6.0.7
$ ls &quot;$FSLDIR&quot;
ls: cannot access &apos;/opt/apps/fsl/6.0.7&apos;: No such file or directory
$ bet --help
bash: bet: command not found
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In their default configurations neither Environment Modules nor Lmod checks that a path exists
before putting it in a variable, and neither treats a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;prepend-path&lt;/code&gt; onto a missing directory as an
error. There is a defensible reason — automounted directories may not be materialized at load
time — but the result is a module that reports success and delivers nothing.&lt;/p&gt;

&lt;p&gt;Harder to spot is the variant where the variable ends up empty rather than wrong. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$FSLDIR/bin/bet&lt;/code&gt;
then expands to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/bin/bet&lt;/code&gt;, and where that path happens to exist you get a different program and
no error at all.&lt;/p&gt;

&lt;p&gt;Make the modulefile assert its preconditions. In Tcl, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;break&lt;/code&gt; ends the evaluation there; Modules
documents that the module is then not listed as loaded and other modules being loaded concurrently
are unaffected, with everything up to that point still performed:&lt;/p&gt;

&lt;div class=&quot;language-tcl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;set root /opt/apps/fsl/6.0.7

if &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;module-info mode load&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &amp;amp;&amp;amp; !&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;file isdirectory $root&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    puts stderr &lt;span class=&quot;s2&quot;&gt;&quot;ERROR: fsl/6.0.7 is not installed on &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;info hostname&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$root&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; missing)&quot;&lt;/span&gt;
    break
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

setenv       FSLDIR $root
prepend-path PATH   $root/bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module-info mode load&lt;/code&gt; guard matters: without it the check also runs during &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module display&lt;/code&gt;,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module avail&lt;/code&gt; and unload, which is noisy and can break &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module purge&lt;/code&gt; on a node where the
directory genuinely is absent. Note also that Modules documents &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;break&lt;/code&gt; on unload as advisory —
a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module unload --force&lt;/code&gt; proceeds anyway — so do not use it to make a module unremovable.&lt;/p&gt;

&lt;p&gt;In Lmod the equivalent is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;if (mode() == &quot;load&quot; and not isDir(root)) then LmodError(...) end&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;8-the-deprecated-module-that-loads-instead-of-failing&quot;&gt;8. The deprecated module that loads instead of failing&lt;/h2&gt;

&lt;p&gt;A version is retired and its install directory removed, but the modulefile stays because deleting
it would “break people’s scripts”. It breaks them anyway, later and less legibly: the load
succeeds, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; gains a directory that is not there, and the user gets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;command not found&lt;/code&gt; from a
module they can see in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Lmod’s admin file is right for a module that still works but should not be used. It is a list of
keys — a module name, or a full path to a modulefile when the key begins with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/&lt;/code&gt; — each followed
by a message that runs to the next blank line:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cat /opt/apps/lmod/etc/admin.list
samtools/1%.9:
    Retired 2026-09-30. Use samtools/1.19.

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Its location is wherever &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LMOD_ADMIN_FILE&lt;/code&gt; was configured to point, which &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module --config&lt;/code&gt; will
tell you.&lt;/p&gt;

&lt;p&gt;Those keys are Lua patterns rather than literal strings, which is the detail that catches people.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.&lt;/code&gt; matches any character and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-&lt;/code&gt; is a quantifier, so a version number wants &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%.&lt;/code&gt; and a module name
containing a dash wants &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%-&lt;/code&gt;. Written as plain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;samtools/1.9&lt;/code&gt; the entry still matches
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;samtools/1.9&lt;/code&gt;, and also &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;samtools/119&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Loading a module that matches prints a block in this shape and then loads it:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module load samtools/1.9

-----------------------------------------------------------------
There are messages associated with the following module(s) :
-----------------------------------------------------------------
samtools/1.9:
    Retired 2026-09-30. Use samtools/1.19.
-----------------------------------------------------------------
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note what that does: it prints and loads. The Lmod documentation is explicit that the admin file
“in no way controls user access to the module”. That is correct for a deprecation window and wrong
for a module whose files are gone. For that, the modulefile must refuse:&lt;/p&gt;

&lt;div class=&quot;language-lua highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;LmodError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;[[
samtools/1.9 was removed on 2026-09-30. The installation no longer exists.
Use: module load samtools/1.19
]]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That refuses the load, and Lmod documents that a failed load returns a non-zero exit code you can
trap. Confirm that on your own version before a job script leans on it, and confirm it separately
under Tcl Environment Modules, where the exit status of a failed load has not always been reliable.&lt;/p&gt;

&lt;p&gt;State the principle plainly, because it is the one people argue about: a module that cannot do its
job must fail at load time, loudly, with a non-zero exit. A job that dies in the first second with
a clear message is a five-minute fix. A job that runs nine hours and fails at the output stage
because one of six tools was missing costs a day, and nobody will connect it to a module that
loaded successfully that morning.&lt;/p&gt;

&lt;h2 id=&quot;9-build-host-paths-baked-into-a-shared-installation&quot;&gt;9. Build-host paths baked into a shared installation&lt;/h2&gt;

&lt;p&gt;This one is not the module system’s fault, but the module system is where it surfaces: software
that works perfectly on the node it was compiled on and nowhere else.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ module load rstudio-deps/2026.05
$ R -e &apos;library(sf)&apos;
Error: package or namespace load failed for &apos;sf&apos;:
 unable to load shared object &apos;/shared/apps/R/4.4.1/library/sf/libs/sf.so&apos;:
  libproj.so.25: cannot open shared object file: No such file or directory
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It works on the build node because the library was in that node’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/lib64&lt;/code&gt;, or because the
build shell had an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LD_LIBRARY_PATH&lt;/code&gt; no other shell has. Four things get baked in:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# 1. RPATH/RUNPATH pointing at a build-only directory
$ readelf -d /shared/apps/tool/bin/tool | grep RUNPATH
 0x000000000000001d (RUNPATH)   Library runpath: [/scratch/build/deps/lib]

# 2. libraries resolving outside the install tree, or not at all
$ ldd /shared/apps/tool/bin/tool | grep -v &apos;=&amp;gt; /shared&apos;
	libproj.so.25 =&amp;gt; not found

# 3. build paths in generated config, which propagate to everything users compile later
$ grep -n &apos;/scratch/build&apos; /shared/apps/R/4.4.1/lib64/R/etc/Makeconf
128:LDFLAGS = -L/scratch/build/deps/lib

# 4. pkg-config and libtool files carrying an absolute prefix
$ grep -rl &apos;/scratch/build&apos; /shared/apps/tool/lib/pkgconfig/*.pc /shared/apps/tool/lib/*.la
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A fifth catches conda-based installs and looks like a filesystem problem: the shebang length limit.
The kernel reads a fixed-size buffer from the start of an executable, and a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#!&lt;/code&gt; line longer than
that buffer does not survive it. On a kernel with the older 128-byte buffer the line is truncated
and the truncated path is executed, so the error names an interpreter that does not exist while
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls&lt;/code&gt; shows the real one plainly does:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ head -1 /gpfs/shared/apps/genomics/pipelines/annotation/1.2.0/bin/annotate
#!/gpfs/shared/apps/genomics/pipelines/annotation/1.2.0/conda/envs/annotation-tools-py311-bioconda-pinned-2026-05-rebuild/bin/python3.11
$ head -1 /gpfs/shared/apps/genomics/pipelines/annotation/1.2.0/bin/annotate | wc -c
137
$ ./annotate
bash: ./annotate: /gpfs/shared/apps/genomics/pipelines/annotation/1.2.0/conda/envs/annotation-tools-py311-bioconda-pinned-2026-05-rebuild/bin/py: bad interpreter: No such file or directory
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Read the truncation point rather than the message: the path in the error stops at 126 characters,
which is the 128-byte buffer less the two bytes taken by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#!&lt;/code&gt;. That is the signature.&lt;/p&gt;

&lt;p&gt;The number is a kernel compile-time constant, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BINPRM_BUF_SIZE&lt;/code&gt; in
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;include/uapi/linux/binfmts.h&lt;/code&gt;, and it is 256 in current mainline. Current kernels also handle the
overflow differently: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fs/binfmt_script.c&lt;/code&gt; returns &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-ENOEXEC&lt;/code&gt; when the interpreter path runs to the
end of the buffer with no terminator after it, rather than executing a path it had to cut. That
changes the symptom instead of removing it — a shell that gets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ENOEXEC&lt;/code&gt; falls back to running the
file itself as a shell script, so a Python entry point fails with shell syntax errors from its own
source instead of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bad interpreter&lt;/code&gt;. Check the constant on the kernel in front of you rather than
quoting either number. The fix is the same in both cases: a shorter install prefix, or a small
POSIX &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sh&lt;/code&gt; wrapper that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exec&lt;/code&gt;s the real interpreter.&lt;/p&gt;

&lt;p&gt;The rule that prevents all five: never validate a build on the node that produced it. Build
anywhere; test on a node that has never had the toolchain loaded.&lt;/p&gt;

&lt;h2 id=&quot;the-principle-and-a-harness&quot;&gt;The principle, and a harness&lt;/h2&gt;

&lt;p&gt;A modulefile is a contract: load me and this tool will run. A contract that fails silently is
worse than no contract, because the user stops checking. If a module cannot keep its promise it
must say so at load time, in the shell the user is sitting in, with a non-zero exit.&lt;/p&gt;

&lt;p&gt;Hold it to that by testing the promise directly — load it in a shell with nothing inherited and
execute the binary. Not &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls&lt;/code&gt; the directory, not check the variable. Run the thing.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# modcheck.sh — load each module in a clean shell and actually run its binary.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Manifest is tab-separated:  &amp;lt;module&amp;gt;  &amp;lt;binary&amp;gt;  &amp;lt;smoke arguments&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;MANIFEST&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;:?usage:&lt;span class=&quot;p&quot;&gt; modcheck.sh manifest.tsv&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;INIT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MODULE_INIT&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;/usr/share/lmod/lmod/init/bash&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;MP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MODULEPATH&lt;/span&gt;:?MODULEPATH&lt;span class=&quot;p&quot;&gt; must be set in the calling shell&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;fail&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0

&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;IFS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;$&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; mod bin args &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;mod&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-z&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;mod&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;mod&lt;/span&gt;:0:1&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;continue

    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;env&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;HOME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;USER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$USER&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;LOGNAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$USER&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;TERM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;dumb &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/bin:/bin &lt;span class=&quot;nv&quot;&gt;MODULEPATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$MP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
          bash &lt;span class=&quot;nt&quot;&gt;--noprofile&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--norc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;
            source &quot;$1&quot; &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 || exit 91
            set -u
            module load &quot;$2&quot; &amp;gt;/dev/null || exit 92
            case &quot;:${LOADEDMODULES:-}:&quot; in
              *&quot;:$2:&quot;*|*&quot;:$2/&quot;*) ;;
              *) exit 92 ;;
            esac
            command -v &quot;$3&quot; &amp;gt;/dev/null  || exit 93
            exec &quot;$3&quot; $4
          &apos;&lt;/span&gt; _ &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$INIT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mod&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$bin&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; 2&amp;gt;&amp;amp;1&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;rc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$?&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$rc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ne&lt;/span&gt; 0 &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;fail&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$rc&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in
      &lt;/span&gt;0&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;ok    %-28s %s\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mod&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$bin&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
      91&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;INIT  %-28s init script missing: %s\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mod&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$INIT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
      92&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;LOAD  %-28s module did not load\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mod&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
      93&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;PATH  %-28s loaded, but %s is not on PATH\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mod&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$bin&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;RUN   %-28s %s exited %d: %s\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mod&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$bin&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$rc&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
                 &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;%s&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$out&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;esac&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; &amp;lt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$MANIFEST&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;exit&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$fail&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Run against a manifest of four modules — one good, one that sets variables but puts no binary on
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt;, one whose binary runs and fails, and one whose modulefile is gone:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ./modcheck.sh manifest.tsv
ok    samtools/1.19                samtools
PATH  toolkit/1.4                  loaded, but toolkit is not on PATH
RUN   gatk/4.5.0.0                 gatk exited 1: Error: LinkageError occurred while loading main class org.broadinstitute.hellbender.Main
LOAD  samtools/1.9                 module did not load
$ echo $?
1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Several things there are deliberate. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;env -i&lt;/code&gt; stops your interactive session leaking in, which is
the only way to catch a module that works for you because of your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt;. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--noprofile --norc&lt;/code&gt;
stops the site profile quietly fixing the problem. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set -u&lt;/code&gt; is applied &lt;em&gt;after&lt;/em&gt; the init script is
sourced, because module init scripts are not written to survive it. The load is checked twice —
exit status and then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LOADEDMODULES&lt;/code&gt; — which is the rule from section 5 applied to the harness
itself; a partial load reported as success is exactly what this is meant to catch. The sentinel
exit codes are 91 to 93 rather than 2 to 4 so that a tool exiting 3 on its own account is not
misfiled as a load failure. And the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exec&lt;/code&gt; runs the real binary rather than testing for its
presence — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$4&lt;/code&gt; is deliberately unquoted so the smoke arguments word-split.&lt;/p&gt;

&lt;p&gt;Run it on more than one node — that is what catches the build-host class:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ for n in $NODES; do echo &quot;== $n&quot;; srun -N1 -w &quot;$n&quot; --time=10 ./modcheck.sh manifest.tsv; done
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Run it from a batch job as well as a login node. Those environments differ, and a module that only
works interactively fails for every job.&lt;/p&gt;

&lt;h2 id=&quot;symptom-against-cause&quot;&gt;Symptom against cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Likely cause&lt;/th&gt;
      &lt;th&gt;Command that confirms it&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;command not found&lt;/code&gt; right after a successful load&lt;/td&gt;
      &lt;td&gt;load happened in a subshell (pipe, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$( )&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xargs&lt;/code&gt;, make recipe)&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;echo &quot;$LOADEDMODULES&quot;&lt;/code&gt; in the shell that matters&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list&lt;/code&gt; shows nothing but the load printed no error&lt;/td&gt;
      &lt;td&gt;same, or the output went to stderr (Lmod’s default) and was filtered by a pipe&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list 2&amp;gt;&amp;amp;1&lt;/code&gt;, or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module -t list&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;which&lt;/code&gt; shows the new binary, old version still runs&lt;/td&gt;
      &lt;td&gt;a shell function or alias of the same name, which &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;which&lt;/code&gt; cannot see&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type &amp;lt;cmd&amp;gt;&lt;/code&gt;; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;command &amp;lt;cmd&amp;gt;&lt;/code&gt; to bypass once&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Same, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type&lt;/code&gt; says “hashed”&lt;/td&gt;
      &lt;td&gt;stale command hash — only possible when &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; itself did not change&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type &amp;lt;cmd&amp;gt;&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hash&lt;/code&gt;; clear with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hash -r&lt;/code&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rehash&lt;/code&gt; in tcsh)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ModuleNotFoundError&lt;/code&gt; for a package that is installed&lt;/td&gt;
      &lt;td&gt;module set a venv variable but no interpreter on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3 -c &quot;import sys; print(sys.executable)&quot;&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Unrelated Python scripts break after loading a tool&lt;/td&gt;
      &lt;td&gt;module prepended an interpreter and shadowed the system one&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type -a python3&lt;/code&gt;; fix with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;family()&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Two modules loaded, second one’s tool wins silently&lt;/td&gt;
      &lt;td&gt;no &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;family&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conflict&lt;/code&gt; declared&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list 2&amp;gt;&amp;amp;1&lt;/code&gt; then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type -a&lt;/code&gt; on the contested binary&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Works loaded one per line, fails in a single command&lt;/td&gt;
      &lt;td&gt;modulefile shelling out, or a partial load reported as success&lt;/td&gt;
      &lt;td&gt;load in one command, then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list 2&amp;gt;&amp;amp;1&lt;/code&gt; and compare against what you asked for&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UnsupportedClassVersionError: class file version N&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;tool built for a newer JDK than the default&lt;/td&gt;
      &lt;td&gt;Java release = N − 44; add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;prereq java/&amp;lt;n&amp;gt;&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Variable set, directory absent, no error&lt;/td&gt;
      &lt;td&gt;modulefile copied between clusters without an existence check&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls &quot;$THAT_VAR&quot;&lt;/code&gt;; add a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;break&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LmodError&lt;/code&gt; guard&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$VAR/bin/tool&lt;/code&gt; resolves to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/bin/tool&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;variable expanded to empty string&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;echo &quot;[${VAR:-UNSET}]&quot;&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Module in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list&lt;/code&gt;, binary missing from disk&lt;/td&gt;
      &lt;td&gt;retired install, modulefile left behind&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module show &amp;lt;mod&amp;gt; 2&amp;gt;&amp;amp;1&lt;/code&gt;, then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls&lt;/code&gt; each path it prints&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libX.so.N: cannot open shared object file&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;build-host library not present on this node&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ldd &amp;lt;binary&amp;gt;&lt;/code&gt;; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;readelf -d &amp;lt;binary&amp;gt; \| grep RUNPATH&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GLIBCXX_3.4.NN not found&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;built against a newer libstdc++ than the runtime provides&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;strings &amp;lt;libstdc++ in use&amp;gt; \| grep GLIBCXX \| sort -V \| tail -1&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bad interpreter: No such file or directory&lt;/code&gt;, file exists&lt;/td&gt;
      &lt;td&gt;shebang longer than the kernel’s buffer (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BINPRM_BUF_SIZE&lt;/code&gt;), path truncated&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;head -1 &amp;lt;script&amp;gt; \| wc -c&lt;/code&gt; and compare with the length in the error text&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Shell syntax errors from a Python or Perl entry point&lt;/td&gt;
      &lt;td&gt;same overflow on a newer kernel: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ENOEXEC&lt;/code&gt;, and the shell then runs the file itself&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;head -1 &amp;lt;script&amp;gt; \| wc -c&lt;/code&gt; against &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BINPRM_BUF_SIZE&lt;/code&gt; on that node&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Works on a login node, fails in a batch job&lt;/td&gt;
      &lt;td&gt;different profile scripts or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MODULEPATH&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;run the same check under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun&lt;/code&gt; and diff the environments&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Works for you, fails for a user&lt;/td&gt;
      &lt;td&gt;something in your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;re-test under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;env -i ... bash --noprofile --norc&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;When a module appears to load but the tool fails, inspect the environment in the shell that will run it. A missing change, a change made only in a child shell or a stale path can make the application look broken even when its installation is intact.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>PowerScale and Isilon NFS performance: a Linux-to-OneFS investigation</title>
    <link href="https://www.wirewalk.com/writing/powerscale-isilon-nfs-performance-troubleshooting/"/>
    <published>2026-07-27T00:00:00-04:00</published>
    <updated>2026-10-18T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/powerscale-isilon-nfs-performance-troubleshooting/</id>
    <summary>Troubleshoot PowerScale and Isilon NFS performance from Linux clients through SmartConnect to OneFS, separating metadata, data, network, and background work.</summary>
    <content type="html">&lt;p&gt;When someone reports that “Isilon is slow,” ask them to show one slow operation. Record the client, path and time, then follow that request through the Linux mount, network connection and OneFS resources. That gives both teams something specific to investigate.&lt;/p&gt;

&lt;p&gt;The commands below inspect state without changing it. Plan any release-specific administrative change separately, with a workload measurement to check its effect.&lt;/p&gt;

&lt;h2 id=&quot;capture-a-reproducible-symptom&quot;&gt;Capture a reproducible symptom&lt;/h2&gt;

&lt;p&gt;Choose a representative job and record its inputs, concurrency, duration and useful output rate. State whether the regression is in file opens, directory operations, sequential reads, random reads, writes or close/commit behavior.&lt;/p&gt;

&lt;p&gt;Record a precise time window and the affected nodes. Compare it with an unaffected job or an earlier baseline only when dataset, client count and cache conditions are comparable. An aggregate daily throughput graph can hide a five-minute tail-latency problem.&lt;/p&gt;

&lt;p&gt;For AI training, correlate batch wait and step duration with storage behavior. For analysis workloads, distinguish time spent reading from time spent decompressing and computing.&lt;/p&gt;

&lt;h2 id=&quot;establish-what-the-linux-client-actually-mounted&quot;&gt;Establish what the Linux client actually mounted&lt;/h2&gt;

&lt;p&gt;On an affected Linux compute node, inspect the mount and NFS statistics:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;findmnt &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; nfs,nfs4
nfsstat &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/self/mountstats
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Tool availability and output vary by distribution. Preserve the mount version, server address, options and the relevant statistics. Use interval deltas for cumulative counters; a total collected since boot does not locate today’s incident.&lt;/p&gt;

&lt;p&gt;Do not copy a mount recipe from another cluster without checking support, failure behavior and its workload. A throughput improvement that changes error handling or application semantics needs explicit review.&lt;/p&gt;

&lt;h2 id=&quot;verify-connection-distribution-rather-than-assuming-it&quot;&gt;Verify connection distribution rather than assuming it&lt;/h2&gt;

&lt;p&gt;Dell’s &lt;a href=&quot;https://www.dell.com/support/kbdoc/en-in/000008416/onefs-how-smartconnect-connection-policies-distribute-client-connections&quot;&gt;SmartConnect connection-policy explanation&lt;/a&gt; distinguishes round-robin, connection-count, network-throughput and CPU policies. That is a reason to inspect the configured policy and the observed client distribution, not to switch policies reflexively.&lt;/p&gt;

&lt;p&gt;Map affected clients to their active endpoints. Ask whether slow clients concentrate on a node, subnet, switch path or workload. DNS responses alone do not show where existing connections are carrying traffic.&lt;/p&gt;

&lt;p&gt;Observe client and switch interfaces for errors, drops and saturation during the same interval. Healthy link speed is not evidence of healthy delivered throughput.&lt;/p&gt;

&lt;h2 id=&quot;split-metadata-pressure-from-data-transfer&quot;&gt;Split metadata pressure from data transfer&lt;/h2&gt;

&lt;p&gt;Run separate controlled tests for opens and directory operations, large-file transfer, and the application’s actual access pattern. Keep test namespaces isolated and cap load so diagnosis does not become another incident.&lt;/p&gt;

&lt;p&gt;If metadata latency rises while bytes transferred remain modest, investigate file count, directory access and concurrency. If large-file reads scale until a particular client or network path saturates, expanding the storage backend may not address that ceiling.&lt;/p&gt;

&lt;p&gt;Use per-client and per-node observations. A cluster-wide average can look healthy while the rank that determines the training step is waiting.&lt;/p&gt;

&lt;h2 id=&quot;correlate-onefs-background-work-and-placement&quot;&gt;Correlate OneFS background work and placement&lt;/h2&gt;

&lt;p&gt;Dell’s &lt;a href=&quot;https://infohub.delltechnologies.com/en-sg/l/storage-tiering-with-dell-powerscale-smartpools/job-engine/&quot;&gt;Job Engine guidance&lt;/a&gt; describes background protection and cluster tasks. Include active jobs and maintenance events in the incident timeline alongside foreground workload and resource metrics.&lt;/p&gt;

&lt;p&gt;Correlation is a lead, not proof. Do not disable protection work to make a benchmark look better. If a supported scheduling or impact-policy adjustment is justified, capture a baseline, define a rollback and remeasure both foreground behavior and the delayed background obligation.&lt;/p&gt;

&lt;p&gt;Check data placement and available capacity with the cluster owner. Uneven workload placement, node resources and client distribution can produce different symptoms despite similar aggregate free space.&lt;/p&gt;

&lt;h2 id=&quot;change-one-variable-and-retain-evidence&quot;&gt;Change one variable and retain evidence&lt;/h2&gt;

&lt;p&gt;For each proposed fix, predict the observable effect before applying it. If connection distribution is the hypothesis, endpoint load should change. If preprocessing is the bottleneck, CPU and loader timing should improve without requiring greater storage bandwidth.&lt;/p&gt;

&lt;p&gt;Repeat the same workload after the change. Keep useful throughput, tail latency, errors and resource pressure in the result. If the application is still slow, keep that open even when link and error checks pass.&lt;/p&gt;

&lt;p&gt;Pair this workflow with &lt;a href=&quot;/writing/powerscale-isilon-ai-hpc-storage-design/&quot;&gt;PowerScale architecture for AI/HPC&lt;/a&gt;, &lt;a href=&quot;/writing/ior-mdtest-parallel-storage/&quot;&gt;storage benchmarking&lt;/a&gt;, and &lt;a href=&quot;/writing/distributed-ai-checkpoint-storage-restart-testing/&quot;&gt;distributed checkpoint testing&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Restore benchmarks: measure the time until the business can work</title>
    <link href="https://www.wirewalk.com/writing/restore-benchmark-business-recovery/"/>
    <published>2026-07-20T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/restore-benchmark-business-recovery/</id>
    <summary>Throughput is one component of recovery. Metadata, identity, keys, and application validation can dominate elapsed time.</summary>
    <content type="html">&lt;p&gt;“Several gigabytes per second” sounds like a fast restore until the team starts rebuilding the service around the copied files. Time the dependency setup, data transfer, validation and application recovery together. The service owner needs to know when people can use it again.&lt;/p&gt;

&lt;h2 id=&quot;define-the-finish-line&quot;&gt;Define the finish line&lt;/h2&gt;

&lt;p&gt;Choose a service and define the recovery-time objective with its owner. Separate data availability from application readiness and business acceptance. Record the recovery point and acceptable data-loss window independently.&lt;/p&gt;

&lt;p&gt;Use a representative dataset: large files, small files, directory depth, permissions, and application metadata. A single large sequential file is an inadequate model for a namespace containing millions of small objects.&lt;/p&gt;

&lt;h2 id=&quot;establish-a-lower-bound&quot;&gt;Establish a lower bound&lt;/h2&gt;

&lt;p&gt;A simple transfer-time calculation is useful as a sanity check:&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;100 TiB / 2 GiB per second = 51,200 seconds = about 14.2 hours
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is arithmetic, not a measured product result. It excludes initialization, metadata work, protocol overhead, retries, and application checks. Use consistent units and actual sustained throughput from the intended recovery route.&lt;/p&gt;

&lt;p&gt;If the business requires recovery in four hours, a fourteen-hour byte-transfer lower bound already demonstrates a design mismatch. No dashboard wording can close that gap.&lt;/p&gt;

&lt;h2 id=&quot;time-the-complete-sequence&quot;&gt;Time the complete sequence&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Milestone&lt;/th&gt;
      &lt;th&gt;Record&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Recovery authorized&lt;/td&gt;
      &lt;td&gt;Start timestamp&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Credentials and keys available&lt;/td&gt;
      &lt;td&gt;Access preparation delay&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Destination ready&lt;/td&gt;
      &lt;td&gt;Provisioning delay&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Namespace available&lt;/td&gt;
      &lt;td&gt;Initial mount or restore completion&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Working set read&lt;/td&gt;
      &lt;td&gt;Cold-access completion&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Application accepted&lt;/td&gt;
      &lt;td&gt;Business validation timestamp&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;WEKA’s &lt;a href=&quot;https://docs.weka.io/weka-filesystems-and-object-stores/snap-to-obj&quot;&gt;Snap-To-Object documentation&lt;/a&gt; notes on-demand recovery considerations. Similar distinctions should be investigated for any product that exposes data before all of it is local. Do not equate a quick mount with a fully recovered working set.&lt;/p&gt;

&lt;h2 id=&quot;avoid-cache-driven-optimism&quot;&gt;Avoid cache-driven optimism&lt;/h2&gt;

&lt;p&gt;Run the first representative read separately from repeat reads. Record whether source or destination caches were warm and whether object-store retrieval was involved. A second run can measure a different system path.&lt;/p&gt;

&lt;p&gt;Measure file-count and metadata progress as well as bytes. Preserve failure and retry counts. A benchmark that silently skipped unreadable files can report excellent throughput while failing its purpose.&lt;/p&gt;

&lt;h2 id=&quot;validate-data-and-authority&quot;&gt;Validate data and authority&lt;/h2&gt;

&lt;p&gt;Compare a pre-recorded manifest, checksums for the test corpus, ownership, and expected access. Then execute an application transaction. Include a denied-access test for an unrelated user so the restored service does not trade availability for excessive exposure.&lt;/p&gt;

&lt;h2 id=&quot;report-the-actual-result&quot;&gt;Report the actual result&lt;/h2&gt;

&lt;p&gt;Publish the dataset, tool versions, topology, elapsed milestones, throughput, errors, and manual interventions. Label estimates as estimates and lab results as lab results. Do not extrapolate a small trial linearly without explaining the limits.&lt;/p&gt;

&lt;p&gt;Give the service owner the measured recovery time and the work that dominated it. If it misses the objective, that identifies what the next exercise needs to improve.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>NVMe controller and namespace management: identify the resource before changing it</title>
    <link href="https://www.wirewalk.com/writing/nvme-controller-namespace-identity-management/"/>
    <published>2026-07-17T10:00:00-04:00</published>
    <updated>2026-07-17T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nvme-controller-namespace-identity-management/</id>
    <summary>Build an NVMe inventory that distinguishes controllers, namespaces, paths and filesystems, then use it to scope namespace changes and replacement work accurately.</summary>
    <content type="html">&lt;p&gt;A device name such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/nvme0n1&lt;/code&gt; is useful for issuing a command on the current host. It is not a durable description of which physical device, namespace and storage service the command will affect after a reboot or replacement.&lt;/p&gt;

&lt;p&gt;Advanced NVMe management begins with that distinction. Before changing namespace layout, format or attachment, build an inventory that connects the NVMe object to its users and to the hardware or remote subsystem behind it. Otherwise a command can succeed against precisely the wrong resource.&lt;/p&gt;

&lt;p&gt;The examples below use the documented &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvme-cli&lt;/code&gt; 2.11 command family on Linux. Check the installed version’s help; newer releases can reorganize commands and output. Device paths are illustrative and must be resolved against the current inventory.&lt;/p&gt;

&lt;h2 id=&quot;separate-the-objects-the-operating-system-presents&quot;&gt;Separate the objects the operating system presents&lt;/h2&gt;

&lt;p&gt;An NVMe subsystem can contain controllers and namespaces. A controller provides an access path and administrative interface. A namespace presents logical blocks; its relationship to physical media depends on the implementation. Linux then builds additional layers such as partitions, encryption, volume management, RAID and filesystems above block devices.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://nvmexpress.org/resource/nvme-namespaces/&quot;&gt;NVM Express namespace overview&lt;/a&gt; explains the distinction between logical address spaces and physical isolation. Creating two namespaces does not automatically provide two independent failure domains or guarantee that each receives a fixed share of performance.&lt;/p&gt;

&lt;p&gt;Record the subsystem identity, controller, namespace identifier and supported persistent namespace identifiers together. Include serial number, model and firmware where relevant. Keep transport address and physical slot mapping as additional evidence, not as substitutes for the namespace identity.&lt;/p&gt;

&lt;h2 id=&quot;inventory-from-the-top-and-the-bottom&quot;&gt;Inventory from the top and the bottom&lt;/h2&gt;

&lt;p&gt;A read-only starting point is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvme version
nvme list &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
nvme list-subsys &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
lsblk &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS,MODEL,SERIAL
findmnt &lt;span class=&quot;nt&quot;&gt;-rn&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; TARGET,SOURCE,FSTYPE
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Some fields depend on tool and distribution versions. Administrative permissions may be required for NVMe identify and log commands. Run only the observations allowed by the site’s operating policy.&lt;/p&gt;

&lt;p&gt;Follow the intended filesystem down through its block-device dependencies. Then follow the intended NVMe namespace upward to every consumer. An unmounted filesystem does not prove the device is unused: a volume group, array, swap area, raw-block application or virtual machine may still depend on it.&lt;/p&gt;

&lt;p&gt;For shared storage, obtain the consumer map from the storage service as well as the current host. One host’s process list cannot establish that a remotely attached namespace has no users elsewhere.&lt;/p&gt;

&lt;h2 id=&quot;read-controller-capabilities-and-namespace-layout-separately&quot;&gt;Read controller capabilities and namespace layout separately&lt;/h2&gt;

&lt;p&gt;For a verified controller and namespace, inspect:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvme id-ctrl /dev/nvme0 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
nvme id-ns /dev/nvme0n1 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The pinned &lt;a href=&quot;https://github.com/linux-nvme/nvme-cli/blob/v2.11/Documentation/nvme-id-ctrl.txt&quot;&gt;Identify Controller&lt;/a&gt; and &lt;a href=&quot;https://github.com/linux-nvme/nvme-cli/blob/v2.11/Documentation/nvme-id-ns.txt&quot;&gt;Identify Namespace&lt;/a&gt; manuals define the interface. When using a controller character device for Identify Namespace, specify the namespace ID as required by the tool. Do not assume that a controller-level query implicitly selects the namespace you intended.&lt;/p&gt;

&lt;p&gt;Record namespace size, capacity and utilization with their units and support context. These values concern logical blocks and allocation at the NVMe layer; they are not interchangeable with a filesystem’s used-space report. A filesystem can retain allocated blocks that do not correspond to current application files, and lower-layer utilization reporting may depend on supported features.&lt;/p&gt;

&lt;p&gt;Retain the active logical-block format and metadata/protection requirements. A capacity figure calculated with the wrong logical-block size is already unreliable before any management operation begins.&lt;/p&gt;

&lt;h2 id=&quot;use-persistent-identity-without-assuming-every-identifier-exists&quot;&gt;Use persistent identity without assuming every identifier exists&lt;/h2&gt;

&lt;p&gt;Check which namespace identifiers the device actually provides and whether they remain appropriate across the lifecycle being managed. An all-zero or missing field should not be promoted into a supposedly unique fleet key.&lt;/p&gt;

&lt;p&gt;Where Linux exposes persistent device links, resolve them and compare the result with Identify data. Keep the raw identity and the resolved current device path in the operation record. Avoid scripts that select the first match to a model name shared by many drives.&lt;/p&gt;

&lt;p&gt;Re-read identity immediately before a planned change. Discovery and execution may be separated by a reboot, reconnect or hardware replacement. A saved path from yesterday is not a sufficient target check for today’s operation.&lt;/p&gt;

&lt;p&gt;If the identity evidence is contradictory, stop the change and resolve the mapping. That is a specific prerequisite, not a request to add a generic confirmation prompt to every read-only observation.&lt;/p&gt;

&lt;h2 id=&quot;describe-the-intended-namespace-change-before-choosing-a-command&quot;&gt;Describe the intended namespace change before choosing a command&lt;/h2&gt;

&lt;p&gt;Separate creating a namespace, attaching it to a controller, changing an active format and preparing a device for retirement. These are different lifecycle actions with different capability requirements and scopes.&lt;/p&gt;

&lt;p&gt;Write down the desired namespace identity, capacity, block format, controller attachments and ownership. Check that the vendor supports the intended operation on the model and firmware. An administrative command exposed by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvme-cli&lt;/code&gt; is not evidence that every device implements it.&lt;/p&gt;

&lt;p&gt;For a populated namespace, determine the migration or recovery plan before changing its structure. Namespace deletion, formatting and related operations can invalidate the data layout. Use the product’s supported procedure and an explicit consumer shutdown or migration boundary; do not improvise a sequence by combining successful commands from unrelated hardware examples.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-resulting-service-not-just-the-identify-response&quot;&gt;Verify the resulting service, not just the identify response&lt;/h2&gt;

&lt;p&gt;After an approved change, re-enumerate the subsystem and namespace. Confirm expected attachments, identity, block format and capacity, then reconcile the Linux storage layers. A new block device appearing is only the first acceptance observation.&lt;/p&gt;

&lt;p&gt;Validate permissions and a bounded write/read/verify cycle in an authorized test location on the intended filesystem. Do not use an active raw namespace as a convenient benchmark destination. Keep scientific data outside the destructive portion of the test.&lt;/p&gt;

&lt;p&gt;For a cluster image or provisioning workflow, test the mapping after reconnect or reboot. Confirm that ordinary jobs see the intended mount and that device enumeration changes do not redirect a local-scratch setup script to another drive.&lt;/p&gt;

&lt;h2 id=&quot;keep-replacement-and-retirement-records-distinct&quot;&gt;Keep replacement and retirement records distinct&lt;/h2&gt;

&lt;p&gt;A replacement device can inherit a mount point or service role while having a different physical identity and endurance history. Record that transition so monitoring does not merge the old and new device into one continuous lifetime.&lt;/p&gt;

&lt;p&gt;Retirement additionally needs the organization’s data-disposition process. A namespace that disappears from the current host is not proof that its former data is unrecoverable, and logical namespace boundaries do not establish the scope of every erase operation.&lt;/p&gt;

&lt;p&gt;Use &lt;a href=&quot;/writing/nvme-health-error-log-endurance-analysis/&quot;&gt;NVMe health and error analysis&lt;/a&gt; for the evidence that often triggers replacement, and &lt;a href=&quot;/writing/nvme-firmware-slots-activation-maintenance/&quot;&gt;firmware lifecycle management&lt;/a&gt; when the planned change affects controller software. Both depend on a reliable identity map.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lustre striping for AI and HPC: match layouts to the workload</title>
    <link href="https://www.wirewalk.com/writing/lustre-striping-ai-hpc-workloads/"/>
    <published>2026-07-11T00:00:00-04:00</published>
    <updated>2026-10-18T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/lustre-striping-ai-hpc-workloads/</id>
    <summary>Choose and test Lustre stripe layouts for AI datasets, shared HPC files and checkpoints. Inspect actual file layouts and compare performance without global changes.</summary>
    <content type="html">&lt;p&gt;A shared checkpoint and a directory of tiny training samples ask different things of Lustre. Spreading every file over every target may help one access pattern and add overhead to another. Choose a stripe layout by testing the workload that will use it.&lt;/p&gt;

&lt;p&gt;Use disposable data and separate test directories for the experiments below. The results apply to those workloads; they are not a recommendation to change the filesystem-wide default.&lt;/p&gt;

&lt;h2 id=&quot;understand-the-layout-before-tuning-it&quot;&gt;Understand the layout before tuning it&lt;/h2&gt;

&lt;p&gt;Lustre separates metadata service from file data stored on object storage targets, or OSTs. A file layout describes how its data is distributed. Stripe count and stripe size govern different aspects of that distribution; neither is equivalent to the number of disks in the storage system.&lt;/p&gt;

&lt;p&gt;The project’s &lt;a href=&quot;https://wiki.lustre.org/Configuring_Lustre_File_Striping&quot;&gt;file striping guide&lt;/a&gt; documents inspecting layouts and setting directory defaults. Use your installed manual pages for the exact supported options and layout features.&lt;/p&gt;

&lt;p&gt;Start with read-only inspection of a representative file and its parent:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lfs getstripe /path/to/lustre/dataset/example-file
lfs getstripe &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /path/to/lustre/dataset
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Do not infer an existing file’s layout from the current parent default. Record both, together with client/server versions and the targets available to the test.&lt;/p&gt;

&lt;h2 id=&quot;classify-the-applications-access-pattern&quot;&gt;Classify the application’s access pattern&lt;/h2&gt;

&lt;p&gt;Describe whether ranks share a file or create independent files. Record transfer size, alignment, file size, reader/writer count, access ordering and synchronization points. Include metadata activity and checkpoint cadence.&lt;/p&gt;

&lt;p&gt;For many independent files, concurrency already exists across files and clients. Wider striping within every small file may add little value. For a large shared file, a narrow layout may constrain the targets that can participate. These are hypotheses to test, not automatic prescriptions.&lt;/p&gt;

&lt;p&gt;AI dataset representation matters too. Sharding many samples into larger containers changes both metadata demand and the I/O pattern. Compare throughput while preserving the sample population, transforms and shuffle requirements.&lt;/p&gt;

&lt;h2 id=&quot;use-a-separate-directory-for-each-layout-experiment&quot;&gt;Use a separate directory for each layout experiment&lt;/h2&gt;

&lt;p&gt;Create disposable test directories through the site’s normal process. Set the intended layout before creating the test files, verify the resulting file layouts, and retain the commands with the result.&lt;/p&gt;

&lt;p&gt;A directory default governs newly created files; changing it is not a bulk rewrite of existing data. Moving or rewriting existing files is a separate operation with space, load and recovery implications.&lt;/p&gt;

&lt;p&gt;Choose a small layout matrix agreed with the storage team. Hold the dataset, rank placement, software and cache conditions fixed. Compare the application’s time to solution, not only a synthetic peak. Avoid production mount-wide changes for an experiment whose outcome is still unknown.&lt;/p&gt;

&lt;h2 id=&quot;consider-progressive-layouts-for-mixed-file-sizes&quot;&gt;Consider progressive layouts for mixed file sizes&lt;/h2&gt;

&lt;p&gt;Progressive file layouts allow a file’s layout to change across size ranges. The Lustre project’s &lt;a href=&quot;https://wiki.lustre.org/Lustre_Striping_Best_Practices&quot;&gt;striping best practices&lt;/a&gt; discusses this and other layout choices. Confirm feature support and the current site policy before experimenting.&lt;/p&gt;

&lt;p&gt;Mixed-size workloads are a reason to evaluate a progressive policy, not proof that a particular threshold is appropriate. Measure small-file overhead, large-file throughput and metadata costs together. Document the actual layout selected for each size range so the result can be reproduced.&lt;/p&gt;

&lt;h2 id=&quot;separate-layout-from-the-rest-of-the-data-path&quot;&gt;Separate layout from the rest of the data path&lt;/h2&gt;

&lt;p&gt;When increasing stripe count stops helping, inspect client CPU, network delivery, target load, backend devices and application synchronization. A layout cannot create bandwidth beyond the path’s limiting component.&lt;/p&gt;

&lt;p&gt;Compare shared-file and file-per-process behavior when the application permits it. Include close and synchronization time in write tests; timing only submission can omit costs the next stage must pay. Record warm-cache and capacity-scale behavior separately.&lt;/p&gt;

&lt;p&gt;If a layout helps isolated bandwidth but worsens other jobs’ latency, the operational result needs more work. The storage system is shared, and a configuration that wins one synthetic test may be unsuitable as a general default.&lt;/p&gt;

&lt;h2 id=&quot;keep-a-layout-decision-record&quot;&gt;Keep a layout decision record&lt;/h2&gt;

&lt;p&gt;For a useful result, retain layout output, file sizes/counts, client and rank placement, concurrency, useful throughput, tail latency and errors. State whether the test used a fresh dataset or a warm cache, and whether other load was present.&lt;/p&gt;

&lt;p&gt;Keep the layout that improves the job without imposing unacceptable costs on neighboring work. Repeat the comparison when file sizes, concurrency or storage hardware change.&lt;/p&gt;

&lt;p&gt;Continue with &lt;a href=&quot;/writing/lustre-metadata-capacity-performance-operations/&quot;&gt;Lustre metadata and capacity diagnosis&lt;/a&gt;, &lt;a href=&quot;/writing/ior-mdtest-parallel-storage/&quot;&gt;IOR and mdtest methodology&lt;/a&gt;, and &lt;a href=&quot;/writing/distributed-ai-checkpoint-storage-restart-testing/&quot;&gt;AI checkpoint recovery&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Intel CPU analysis with VTune, PCM and perf: distinguish cache misses from memory stalls</title>
    <link href="https://www.wirewalk.com/writing/intel-vtune-pcm-core-cache-memory-analysis/"/>
    <published>2026-07-09T10:00:00-04:00</published>
    <updated>2026-07-09T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/intel-vtune-pcm-core-cache-memory-analysis/</id>
    <summary>Combine process-level sampling, core counters and socket-level memory observations to investigate Intel CPU performance without assigning every cache miss to DRAM.</summary>
    <content type="html">&lt;p&gt;A cache-miss count is the start of a question. It does not tell you whether the request reached DRAM, whether another cache supplied the line, or whether the processor overlapped the delay with useful work.&lt;/p&gt;

&lt;p&gt;For an Intel CPU investigation, connect the application’s slow phase to core behavior and then to the memory subsystem. VTune can attribute activity to code and threads. Intel Performance Counter Monitor supplies useful platform-level views. Linux &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perf&lt;/code&gt; can provide a compact repeatable measurement when the selected events are supported and permitted.&lt;/p&gt;

&lt;h2 id=&quot;inventory-the-cpu-set-the-application-can-actually-use&quot;&gt;Inventory the CPU set the application can actually use&lt;/h2&gt;

&lt;p&gt;Record processor model, stepping, topology, firmware settings relevant to the experiment, kernel and profiler versions. Include the batch allocation and the process’s allowed CPUs. A node with many logical CPUs does not necessarily grant a job access to all of them.&lt;/p&gt;

&lt;p&gt;Start with read-only topology observations:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lscpu
lscpu &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;CPU,CORE,SOCKET,NODE
numactl &lt;span class=&quot;nt&quot;&gt;--hardware&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Map threads to physical cores, SMT siblings and NUMA domains. Do not infer memory locality from socket count alone. A processor platform can expose several locality domains within a socket, and firmware policy affects the topology presented to the operating system.&lt;/p&gt;

&lt;p&gt;Retain dataset size and initialization behavior. Memory placement established by the threads that initialize data can persist into the timed phase, making an apparently identical compute loop behave differently.&lt;/p&gt;

&lt;h2 id=&quot;establish-a-small-process-level-baseline&quot;&gt;Establish a small process-level baseline&lt;/h2&gt;

&lt;p&gt;Use the uninstrumented application for elapsed time and correctness. Then add a bounded observation such as:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;perf list
perf &lt;span class=&quot;nb&quot;&gt;stat&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; 3 &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; cycles,instructions &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt; ./solver input.dat
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;solver&lt;/code&gt; and its input are placeholders. The &lt;a href=&quot;https://man7.org/linux/man-pages/man1/perf-stat.1.html&quot;&gt;perf stat manual&lt;/a&gt; documents event counting and reporting. Confirm event availability, permissions and the scope of each result on the actual system.&lt;/p&gt;

&lt;p&gt;Counted instructions and cycles provide context, not a scientific throughput metric. A vector instruction can perform different work from a scalar one, and a more efficient algorithm may retire fewer instructions while taking less time. Keep application output rate beside IPC rather than optimizing the ratio in isolation.&lt;/p&gt;

&lt;h2 id=&quot;locate-the-hot-phase-before-opening-every-metric&quot;&gt;Locate the hot phase before opening every metric&lt;/h2&gt;

&lt;p&gt;A compact VTune collection can begin with:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vtune &lt;span class=&quot;nt&quot;&gt;-collect&lt;/span&gt; hotspots &lt;span class=&quot;nt&quot;&gt;-result-dir&lt;/span&gt; vtune-hotspots &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt; ./solver input.dat
vtune &lt;span class=&quot;nt&quot;&gt;-collect&lt;/span&gt; memory-access &lt;span class=&quot;nt&quot;&gt;-result-dir&lt;/span&gt; vtune-memory &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt; ./solver input.dat
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use separate runs and matching inputs. Collection availability, data detail and overhead depend on the target CPU, permissions and installed collectors. The &lt;a href=&quot;https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2024-0/running-command-line-analysis.html&quot;&gt;VTune command-line guide&lt;/a&gt; describes analysis types and target syntax.&lt;/p&gt;

&lt;p&gt;Identify which functions, threads and intervals dominate the phase. Sampling is evidence about observed execution, with attribution limits. A source line receiving samples may be near the expensive operation rather than a complete explanation of why it is expensive.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-core-execution-limits-from-memory-limits&quot;&gt;Distinguish core execution limits from memory limits&lt;/h2&gt;

&lt;p&gt;Use the supported microarchitecture view to form a hypothesis: front-end delivery, speculation, execution resources, memory latency or bandwidth may be involved. The event formulas and categories depend on processor generation and tool version.&lt;/p&gt;

&lt;p&gt;Keep counts with their denominators. If calculating misses per thousand retired instructions, the miss event and instruction count need compatible scope and interval. A socket-wide count divided by one thread’s instructions produces a number with no useful interpretation.&lt;/p&gt;

&lt;p&gt;Check whether events were multiplexed, unsupported or scaled. Collecting too many events can reduce how long each is observed. Repeat a narrower set when the result is central to the conclusion, especially if activity varies across phases.&lt;/p&gt;

&lt;h2 id=&quot;use-uncore-observations-to-test-the-memory-explanation&quot;&gt;Use uncore observations to test the memory explanation&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/intel/pcm&quot;&gt;Intel PCM&lt;/a&gt; includes tools such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pcm-memory&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pcm-numa&lt;/code&gt; for supported platforms. These can help examine memory-channel traffic and locality-related behavior beyond one process’s sampled hot lines.&lt;/p&gt;

&lt;p&gt;Keep platform scope explicit. A socket’s memory traffic includes other work, operating-system activity and potentially other users. Collect during an isolated maintenance allocation where possible, or retain enough context to describe the contamination.&lt;/p&gt;

&lt;p&gt;Avoid running competing counter tools simultaneously without reviewing their interaction. PMU ownership and collection mechanisms can conflict or reduce available measurements. Coordinate the experiment through the site’s normal profiling policy instead of weakening machine-wide access controls to make every tool run.&lt;/p&gt;

&lt;h2 id=&quot;separate-locality-bandwidth-and-sharing&quot;&gt;Separate locality, bandwidth and sharing&lt;/h2&gt;

&lt;p&gt;Use a controlled comparison rather than diagnosing all three from a single miss ratio:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Hypothesis&lt;/th&gt;
      &lt;th&gt;Focused experiment&lt;/th&gt;
      &lt;th&gt;Evidence to retain&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Remote placement hurts latency&lt;/td&gt;
      &lt;td&gt;Compare supported local and remote placement with the same CPU set and initialization policy&lt;/td&gt;
      &lt;td&gt;Application time, placement evidence, locality and traffic observations&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Memory bandwidth is saturated&lt;/td&gt;
      &lt;td&gt;Vary active cores while keeping the useful work comparable&lt;/td&gt;
      &lt;td&gt;Output rate, memory traffic, per-thread behavior and variation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Threads contend on cache lines&lt;/td&gt;
      &lt;td&gt;Change layout or ownership of the suspected shared objects&lt;/td&gt;
      &lt;td&gt;Correctness, line-sharing evidence, coherence-related observations and elapsed time&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Keep each experiment within the assigned resources. A lower thread count can reduce both bandwidth demand and synchronization, so success at that setting does not identify the cause without supporting evidence.&lt;/p&gt;

&lt;h2 id=&quot;prove-false-sharing-rather-than-inferring-it-from-proximity&quot;&gt;Prove false sharing rather than inferring it from proximity&lt;/h2&gt;

&lt;p&gt;Two threads updating independent values on the same cache line can create coherence traffic. That is different from necessary communication through a genuinely shared value. Find which threads write which locations and inspect the actual object layout.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.intel.com/content/www/us/en/docs/vtune-profiler/cookbook/2025-0/false-sharing.html&quot;&gt;Intel’s false-sharing example&lt;/a&gt; illustrates the kind of attribution required. Its measured speedups belong to that example, not to an arbitrary research code. Padding or partitioning is an experiment whose additional footprint and locality effects must also be measured.&lt;/p&gt;

&lt;p&gt;A reduction in a coherence-related event is useful, but accept the change only after the application remains correct and completes the intended work faster or with a documented resource benefit.&lt;/p&gt;

&lt;h2 id=&quot;finish-with-a-model-specific-conclusion&quot;&gt;Finish with a model-specific conclusion&lt;/h2&gt;

&lt;p&gt;Save the CPU model, event definitions, scope, collection configuration, workload phase and placement with the report. Explain which observation supported the cause and which controlled change tested it.&lt;/p&gt;

&lt;p&gt;Repeat the uninstrumented workload and a representative larger case. A cache optimization that helps a tiny working set may lose its advantage when data grows or another rank shares the socket.&lt;/p&gt;

&lt;p&gt;For the equivalent analysis boundaries on AMD systems, see &lt;a href=&quot;/writing/amd-uprof-ibs-core-cache-numa-analysis/&quot;&gt;AMD CPU core, cache and IBS analysis&lt;/a&gt;. Comparable research questions do not make vendor PMU events interchangeable.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Incident containment: preserve the route you need to investigate and recover</title>
    <link href="https://www.wirewalk.com/writing/incident-containment-preserve-recovery/"/>
    <published>2026-06-26T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/incident-containment-preserve-recovery/</id>
    <summary>Containment decisions should stop harmful activity while preserving evidence and an authorized recovery path.</summary>
    <content type="html">&lt;p&gt;Before isolating a compromised host, check what the isolation will cut off. It may remove the only management route, interrupt evidence collection or strand another service. Work through those choices in the containment playbook while the team has time to examine them.&lt;/p&gt;

&lt;h2 id=&quot;establish-authority-and-scope&quot;&gt;Establish authority and scope&lt;/h2&gt;

&lt;p&gt;Identify who can authorize host isolation, account revocation, storage protection changes, and service shutdown. Keep an incident communication route available outside the systems under investigation.&lt;/p&gt;

&lt;p&gt;Record the known facts separately from hypotheses. A suspicious alert may justify precautionary isolation, but the incident record should not claim confirmed compromise solely because a detection fired.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.cisa.gov/stopransomware/ransomware-guide&quot;&gt;CISA’s ransomware guide&lt;/a&gt; provides incident-response and recovery guidance. The worksheet below is an operational method for applying those objectives to a specific environment.&lt;/p&gt;

&lt;h2 id=&quot;build-a-containment-decision-sheet&quot;&gt;Build a containment decision sheet&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Action&lt;/th&gt;
      &lt;th&gt;Intended effect&lt;/th&gt;
      &lt;th&gt;Dependency to preserve&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;EDR network isolation&lt;/td&gt;
      &lt;td&gt;Restrict host communication&lt;/td&gt;
      &lt;td&gt;Supported responder/management channel&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Account revocation&lt;/td&gt;
      &lt;td&gt;Stop further identity use&lt;/td&gt;
      &lt;td&gt;Independent recovery authority&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Firewall restriction&lt;/td&gt;
      &lt;td&gt;Limit affected traffic&lt;/td&gt;
      &lt;td&gt;DNS, logging, or recovery flows as justified&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Suspend replication workflow&lt;/td&gt;
      &lt;td&gt;Avoid propagating harmful state&lt;/td&gt;
      &lt;td&gt;Existing protected recovery points&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;These are possible actions, not automatic instructions. The incident lead selects them based on scope, platform behavior, and business impact.&lt;/p&gt;

&lt;h2 id=&quot;rehearse-the-endpoint-control&quot;&gt;Rehearse the endpoint control&lt;/h2&gt;

&lt;p&gt;For an EDR product such as Microsoft Defender for Endpoint or another deployed platform, use its current vendor procedure on a lab endpoint. Establish which communication remains available during isolation and how authorized responders reverse it.&lt;/p&gt;

&lt;p&gt;Do not assume all operating systems or agent versions behave identically. Observe the lab endpoint from a second host, verify the responder path, and time restoration. Record what happens if the agent is unhealthy or the endpoint is already offline.&lt;/p&gt;

&lt;h2 id=&quot;preserve-evidence-deliberately&quot;&gt;Preserve evidence deliberately&lt;/h2&gt;

&lt;p&gt;Capture relevant timestamps, alerts, host identity, and action records. Decide with the response team which volatile evidence must be collected before disruptive actions. Avoid publishing sensitive logs in a general collaboration channel.&lt;/p&gt;

&lt;p&gt;Containment should not trigger uncontrolled cleanup. Deleting files or rebuilding immediately can remove evidence needed to establish scope and root cause. Preserve recovery options while the incident team makes that decision.&lt;/p&gt;

&lt;h2 id=&quot;separate-isolation-from-recovery-acceptance&quot;&gt;Separate isolation from recovery acceptance&lt;/h2&gt;

&lt;p&gt;A host can be contained and still be unsafe to reconnect. Establish the criteria for rebuilding or restoring it, rotating exposed credentials, and accepting the recovered application. Confirm the selected recovery point and its dependencies rather than restoring the most recent backup automatically.&lt;/p&gt;

&lt;p&gt;Use a tabletop scenario that includes loss of the normal directory and backup console. It reveals whether the procedure depends on the same authority that may be compromised.&lt;/p&gt;

&lt;h2 id=&quot;record-outcomes-not-just-button-clicks&quot;&gt;Record outcomes, not just button clicks&lt;/h2&gt;

&lt;p&gt;Keep the requested action, observed network effect, remaining access, evidence preserved, and restoration result. Test the allowed and denied connections after isolation, rather than relying on the console label.&lt;/p&gt;

&lt;p&gt;Continue with &lt;a href=&quot;/writing/recovery-after-admin-compromise/&quot;&gt;recovery after administrator compromise&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Ninety-seven percent of an annotation pipeline was annotating nothing</title>
    <link href="https://www.wirewalk.com/writing/ninety-seven-percent-of-the-work-was-unnecessary/"/>
    <published>2026-06-24T10:00:00-04:00</published>
    <updated>2026-06-24T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/ninety-seven-percent-of-the-work-was-unnecessary/</id>
    <summary>How to find out that the expensive stage of a variant annotation pipeline is spending almost all of its time on records with nothing to annotate, how to remove that work in the right order so you do not silently lose sites, and how to prove the fast output is identical to the slow one.</summary>
    <content type="html">&lt;p&gt;A variant annotation pipeline takes per-sample genomic VCF files in and produces annotated
variants out. It is slow. The obvious response is to make the annotator faster: more forks, faster
storage for the cache, a different annotation tool, a bigger node. All of those are real levers and
all of them are the wrong place to start.&lt;/p&gt;

&lt;p&gt;The right place to start is a stopwatch on each stage, because the shape of this problem recurs: the
annotator is not slow, it is being asked to do roughly thirty-eight times more work than the
question requires. The records it spends its time on carry no alternate allele at all. There is
nothing to annotate, so it annotates nothing, carefully, twenty-five million times per sample.&lt;/p&gt;

&lt;p&gt;The measurements below led to a smaller input stream, followed by checks that the filter preserved every allele that needed annotation. Two tuning parameters helped further, but the file-format caveat at the end determines where this approach is safe to use.&lt;/p&gt;

&lt;h2 id=&quot;measure-the-stages-before-touching-anything&quot;&gt;Measure the stages before touching anything&lt;/h2&gt;

&lt;p&gt;The first number you need is the split of wall time across stages. For a shell pipeline this does
not need a profiler. It needs timestamps that survive into the log:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;stamp&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;%s\t%s\n&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; +%Y-%m-%dT%H:%M:%SZ&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$TIMING&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

stamp &lt;span class=&quot;s2&quot;&gt;&quot;start&quot;&lt;/span&gt;
bcftools index &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$GVCF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;                                   &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; stamp &lt;span class=&quot;s2&quot;&gt;&quot;index&quot;&lt;/span&gt;
run_annotator &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$GVCF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$OUT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;                                &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; stamp &lt;span class=&quot;s2&quot;&gt;&quot;annotate&quot;&lt;/span&gt;
postprocess &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$OUT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;                                          &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; stamp &lt;span class=&quot;s2&quot;&gt;&quot;postprocess&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If the work runs under Slurm, take the per-step figures from the accounting database rather than
from the job script, and take them from the job steps, not the allocation:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sacct -j 4182377 --units=G \
    --format=JobID,JobName%18,Elapsed,TotalCPU,MaxRSS,State
JobID          JobName      Elapsed   TotalCPU     MaxRSS      State
4182377        annot-batch  05:02:11  19:55:38                COMPLETED
4182377.batch  batch        05:02:11  00:01:46      0.31G     COMPLETED
4182377.0      vep          04:53:02  19:41:08         9.8G   COMPLETED
4182377.1      post         00:08:57  00:12:44      1.20G     COMPLETED
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Read the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; column carefully: it is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[DD-]HH:MM:SS&lt;/code&gt;, so a leading day field changes the
value by a factor of twenty-four and is easy to skim past. Here &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;19:41:08&lt;/code&gt; of CPU against &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;04:53:02&lt;/code&gt;
of wall on the annotation step is 4.03x, which is the four forks the step was given and a useful
sanity check that the parallelism you asked for is the parallelism you got.&lt;/p&gt;

&lt;p&gt;Two further warnings about that output, both of which produce confidently wrong answers. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; is
blank on the allocation line because the allocation itself has no measured process tree, so any
memory figure derived from a query with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-X&lt;/code&gt; comes back as zero for every job. And if you derive CPU
efficiency from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt; rather than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; you get 1.0 for every job ever run, because
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt; is allocated core-seconds and not consumed ones. Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; over &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NCPUS * Elapsed&lt;/code&gt;,
and query without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-X&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The split from that run, for one representative sample on one node:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;annotation: 293.0 min&lt;/li&gt;
  &lt;li&gt;everything else — indexing, splitting, post-processing, compression, QC summary: 9.0 min&lt;/li&gt;
  &lt;li&gt;total: 302.0 min&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Annotation is 97.0% of the wall time. Nothing else on the list can matter. If you halved the cost of
every other stage you would save four and a half minutes out of five hours.&lt;/p&gt;

&lt;h2 id=&quot;what-is-actually-in-the-file&quot;&gt;What is actually in the file&lt;/h2&gt;

&lt;p&gt;A per-sample genomic VCF is not a list of variants. It is a description of the whole callable
genome, in which the overwhelming majority of records say “this stretch matches the reference and
here is how confident I am”. Those records carry a symbolic placeholder allele instead of a real
one: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;NON_REF&amp;gt;&lt;/code&gt; for GATK and DRAGEN output, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;*&amp;gt;&lt;/code&gt; for htslib-style gVCF. Reference blocks also
carry an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;END&lt;/code&gt; tag giving the last position of the block.&lt;/p&gt;

&lt;p&gt;The important structural detail is that in a GATK-style gVCF the placeholder is present on &lt;em&gt;every&lt;/em&gt;
record, including real variant records, where it sits last in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT&lt;/code&gt; list. So a reference block
looks like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT=&amp;lt;NON_REF&amp;gt;&lt;/code&gt; and a variant looks like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT=A,&amp;lt;NON_REF&amp;gt;&lt;/code&gt;. The test for “this record has
something to annotate” is therefore not “does the ALT column mention the placeholder” — it is “does
the ALT column contain anything besides the placeholder”.&lt;/p&gt;

&lt;p&gt;That distinction has teeth in bcftools expression syntax, because a comma inside a string is read as
a value separator and multiple values are combined with OR. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT=&quot;&amp;lt;NON_REF&amp;gt;&quot;&lt;/code&gt; is therefore &lt;em&gt;true&lt;/em&gt; for
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT=A,&amp;lt;NON_REF&amp;gt;&lt;/code&gt; — it matches the second value and stops caring about the first. Written alone as an
exclude expression it would discard every variant record in the file. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N_ALT=1&lt;/code&gt; conjunction is
what narrows it to records where the placeholder is the only allele, and it is the whole reason the
filter is two clauses rather than one.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bcftools view -H sample.g.vcf.gz | head -4 | cut -f1-5,10
chr1  10001  .  T  &amp;lt;NON_REF&amp;gt;    0/0:...
chr1  10002  .  A  &amp;lt;NON_REF&amp;gt;    0/0:...
chr1  10108  .  C  CAACCCT,&amp;lt;NON_REF&amp;gt;  0/1:...
chr1  10109  .  A  &amp;lt;NON_REF&amp;gt;    0/0:...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Count both classes:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bcftools view -H sample.g.vcf.gz | wc -l
26584113

$ bcftools view -H -e &apos;N_ALT=1 &amp;amp;&amp;amp; ALT=&quot;&amp;lt;NON_REF&amp;gt;&quot;&apos; sample.g.vcf.gz | wc -l
690412
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;690,412 out of 26,584,113 is 2.60%. Removing the rest is a 38.5-fold reduction in records entering
the stage that is 97% of the cost.&lt;/p&gt;

&lt;p&gt;Two honest caveats on those figures. They are one file, and absolute record counts in gVCFs are not
portable: reference-block banding differs sharply between callers and settings, and a file emitted at
base-pair resolution has a record per callable base, which is two orders of magnitude more. The
&lt;em&gt;ratio&lt;/em&gt; is the durable number, and across the per-sample whole-genome gVCFs I have counted it sits in
the low single digits of a percent. If your own files give a ratio above about ten percent, either
they are not per-sample gVCFs or the caller banding is unusual, and you should check before assuming
this result transfers.&lt;/p&gt;

&lt;p&gt;Cross-check the classification against the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;END&lt;/code&gt; tag rather than trusting a single expression:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bcftools query -f &apos;%INFO/END\n&apos; sample.g.vcf.gz | grep -cv &apos;^\.$&apos;
25893701
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;25,893,701 records carry an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;END&lt;/code&gt;, and 26,584,113 − 690,412 = 25,893,701. Two tests reading two
different fields — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;INFO/END&lt;/code&gt; — agree exactly, which is the point of running both. They are
not fully independent, since a caller that got one wrong could plausibly get the other wrong the same
way, but they do catch the failure that actually happens, which is an expression that means something
other than what you thought it meant.&lt;/p&gt;

&lt;h2 id=&quot;the-pipeline&quot;&gt;The pipeline&lt;/h2&gt;

&lt;p&gt;Order matters, for reasons covered in the next section. Filter first, split multi-allelic records
second, drop the placeholder third.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-euo&lt;/span&gt; pipefail

&lt;span class=&quot;nv&quot;&gt;REF&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/ref/GRCh38.fa
&lt;span class=&quot;nv&quot;&gt;IN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;sample.g.vcf.gz
&lt;span class=&quot;nv&quot;&gt;SITES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;sample.sites.vcf.gz

bcftools view &lt;span class=&quot;nt&quot;&gt;--threads&lt;/span&gt; 4 &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;N_ALT=1 &amp;amp;&amp;amp; ALT=&quot;&amp;lt;NON_REF&amp;gt;&quot;&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Ou&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$IN&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | bcftools norm &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-any&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Ou&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | bcftools view &lt;span class=&quot;nt&quot;&gt;--threads&lt;/span&gt; 4 &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;ALT=&quot;&amp;lt;NON_REF&amp;gt;&quot; || ALT=&quot;*&quot;&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Oz&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SITES&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

bcftools index &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SITES&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--threads&lt;/code&gt; appears only on the first and last commands on purpose. It is a BGZF compression and
decompression pool, so it buys something where a bgzipped file is being read and where one is being
written, and nothing at all on the middle stage, which takes uncompressed BCF on a pipe and emits the
same. Putting it everywhere is harmless but it is cargo cult, and it makes the stage look more
parallel than it is.&lt;/p&gt;

&lt;p&gt;After &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;norm -m -any&lt;/code&gt;, a record with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT=A,&amp;lt;NON_REF&amp;gt;&lt;/code&gt; becomes two records, one with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT=A&lt;/code&gt; and one
with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT=&amp;lt;NON_REF&amp;gt;&lt;/code&gt;, so the final &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;view&lt;/code&gt; removes the now-standalone placeholders. The same pass
drops spanning-deletion &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*&lt;/code&gt; alleles. A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*&lt;/code&gt; is not a new allele: it marks a position overlapped by a
deletion called at an earlier position, so there is no consequence to compute for it. Drop them
deliberately rather than letting the annotator decide.&lt;/p&gt;

&lt;p&gt;Then annotate the small file:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vep &lt;span class=&quot;nt&quot;&gt;--offline&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--cache&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--dir_cache&lt;/span&gt; /ref/vep &lt;span class=&quot;nt&quot;&gt;--assembly&lt;/span&gt; GRCh38 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--fasta&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--format&lt;/span&gt; vcf &lt;span class=&quot;nt&quot;&gt;--vcf&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--compress_output&lt;/span&gt; bgzip &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--allele_number&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--no_stats&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--fork&lt;/span&gt; 4 &lt;span class=&quot;nt&quot;&gt;--buffer_size&lt;/span&gt; 50000 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SITES&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; sample.vep.vcf.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allele_number&lt;/code&gt; is the one flag here whose purpose is routinely misread, including by me when I
first wrote this pipeline. The documentation says it will “identify allele number from VCF input,
where 1 = first ALT allele, 2 = second ALT allele etc.” The obvious reading is that it preserves the
&lt;em&gt;pre-split&lt;/em&gt; allele ordering so you can get back to the original multi-allelic record. It does not. The
index it records is the index within the file VEP was handed, and that file has already been split, so
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALLELE_NUM&lt;/code&gt; is 1 on every record. Recovering the unsplit record is a join on position plus &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;REF&lt;/code&gt; and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT&lt;/code&gt;, and no VEP flag does it for you.&lt;/p&gt;

&lt;p&gt;The flag still earns its place, for a different reason. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Allele&lt;/code&gt; field inside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CSQ&lt;/code&gt; is a minimal
representation — VEP trims the sequence common to the reference and alternate alleles off both ends
before computing consequences — so for an insertion written as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;REF=C ALT=CAACCCT&lt;/code&gt; the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CSQ&lt;/code&gt; allele is
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AACCCT&lt;/code&gt;, which matches nothing in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT&lt;/code&gt; column. String-matching &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CSQ&lt;/code&gt; alleles against &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT&lt;/code&gt; works
for SNVs and quietly fails for indels. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALLELE_NUM&lt;/code&gt; being unconditionally 1 is what makes that
matching unnecessary: one input allele per record, so every consequence block on that record — and
there is one per overlapping transcript — belongs to that allele, tied by index rather than by
string.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--no_stats&lt;/code&gt; is worth a mention, with the caveat that the VEP documentation itself describes the
saving as marginal. I did not measure it in isolation, and on a 690,412-record input I would not
expect it to be visible against the other numbers here. The reason to set it is not speed, it is that
the summary is an HTML file nobody opens in a batch run and one more artefact per sample to clean up.&lt;/p&gt;

&lt;h2 id=&quot;the-correctness-trap&quot;&gt;The correctness trap&lt;/h2&gt;

&lt;p&gt;The first version of the filter was one command instead of three, and it used &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--trim-alt-alleles&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# WRONG - do not do this&lt;/span&gt;
bcftools view &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;N_ALT=1 &amp;amp;&amp;amp; ALT=&quot;&amp;lt;NON_REF&amp;gt;&quot;&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$IN&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Oz&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SITES&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-a&lt;/code&gt; removes alternate alleles that are not present in any genotype. On a gVCF this looks like
exactly what you want: it strips the placeholder, it strips alleles the caller considered and
rejected, and it leaves a tidy file. The output was slightly smaller on disk than the three-command
version — not fewer records, fewer bytes — which read as the filter working harder.&lt;/p&gt;

&lt;p&gt;It was not working harder. It was throwing away 2,157 sites per file, and the record count did not
move, which is exactly why it took a two-way comparison to find.&lt;/p&gt;

&lt;p&gt;The sites it lost all had the same shape: a real alternate allele in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT&lt;/code&gt;, and a genotype that did
not use it. Hom-ref and no-call genotypes on records that nonetheless carry a called alternate allele
are ordinary in a gVCF — the caller saw allele evidence, emitted the allele, and genotyped the sample
as reference or as uncallable. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-a&lt;/code&gt; sees an allele absent from the genotype and removes it — and it
removes the placeholder on the same grounds, because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;NON_REF&amp;gt;&lt;/code&gt; is not in any genotype either. The
documented behavior when nothing survives is the part that bites: “if no alternate allele remains
after trimming, the record itself is not removed but ALT is set to ‘.’”. So the record stays. It
passes the exclude expression, because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N_ALT&lt;/code&gt; is now zero and the expression asks about &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;N_ALT=1&lt;/code&gt;. It
is counted in the filter output. It simply has no allele left to annotate, and it falls out inside the
annotator instead of at the filter, which is why the record count after the filter stage still looks
right. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-a&lt;/code&gt; also trims &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Number=A&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;G&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;R&lt;/code&gt; tags to match, so the per-allele fields go with it.&lt;/p&gt;

&lt;p&gt;The near-neighbour makes this worse. bcftools 1.19 added &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-A, --trim-unseen-allele&lt;/code&gt;, which removes
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;*&amp;gt;&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;NON_REF&amp;gt;&lt;/code&gt; specifically — at variant sites with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-A&lt;/code&gt;, at all sites with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-AA&lt;/code&gt; — without ever
consulting a genotype. That is the operation the first version was reaching for. One character of
difference between the flag that is safe here and the flag that silently drops called sites, and no
error from either.&lt;/p&gt;

&lt;p&gt;Here is what finding it looked like. Compare the fast output against the baseline, in both
directions:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bcftools isec -C -w1 baseline.norm.vcf.gz fast.vep.vcf.gz | grep -vc &apos;^#&apos;
2157
$ bcftools isec -C -w1 fast.vep.vcf.gz baseline.norm.vcf.gz | grep -vc &apos;^#&apos;
0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Asymmetric loss, which immediately rules out a representation difference — those show up in both
directions. Then look at what was lost:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bcftools isec -C -w1 baseline.norm.vcf.gz fast.vep.vcf.gz \
    | bcftools query -f &apos;[%GT]\n&apos; - | sort | uniq -c | sort -rn
   1188 ./.
    902 0/0
     67 0|0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Every single lost site has a genotype that does not use the allele. That is the fingerprint, and it
points straight at the trimming flag.&lt;/p&gt;

&lt;p&gt;Whether this matters depends on what the annotated output is for. If the only consumer is a
per-sample report of the variants this sample carries, the lost records were arguably noise. If the
output feeds a review queue, a re-genotyping step, a family or cohort comparison where “the caller
saw this allele and called hom-ref” is different from “the caller never saw this allele”, or any
regulated workflow where the site list must be reproducible, then losing 2,157 sites per sample
without a log line is unacceptable. Removing work that is genuinely unnecessary is optimization.
Removing work you did not know you were doing is data loss, and the two are indistinguishable until
you compare outputs.&lt;/p&gt;

&lt;p&gt;The fix is the ordering above: filter on the placeholder alone, split, then drop what the split
exposed. No stage ever consults a genotype, so no stage can drop a record for having the wrong one.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-A&lt;/code&gt; would do the third step too, and on a recent enough bcftools it is the more direct spelling; the
explicit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;view -e&lt;/code&gt; is what I left in because it also handles the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*&lt;/code&gt; alleles and because it says out
loud what is being removed.&lt;/p&gt;

&lt;h2 id=&quot;what-it-cost-and-what-it-saved&quot;&gt;What it cost and what it saved&lt;/h2&gt;

&lt;p&gt;One sample, one node, single file at a time:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Stage&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;Baseline&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;Filter only&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;Filter + tuned annotator&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Filter, split, index&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;—&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;5.5 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;5.5 min&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Annotation&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;293.0 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;7.6 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;5.4 min&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Post-processing, compress, QC&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;9.0 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;9.0 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;9.0 min&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Total wall&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;&lt;strong&gt;302.0 min&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;&lt;strong&gt;22.1 min&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;&lt;strong&gt;19.9 min&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Speed-up vs baseline&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.0x&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;13.7x&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;15.2x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Records entering annotation&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;26,584,113&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;690,412&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;690,412&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Mean cost per record&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.661 ms&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.661 ms&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.469 ms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Peak RSS, annotation&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;9.8 GB&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;4.1 GB&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;11.6 GB&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The row that changed how I think about this is the second-to-last one. Before measuring, the
expectation was that reference blocks would be much cheaper per record than variant records — a
block has no consequence to compute, and a variant has to be intersected with every overlapping
transcript. If that were true, removing 97% of the records would remove far less than 97% of the
time, and the whole exercise would disappoint.&lt;/p&gt;

&lt;p&gt;The measurement says the opposite. Cost per record was flat to three significant figures across a
38-fold change in what was in the file. The fixed per-record overhead — parse, buffer, region lookup,
serialize — dominates the consequence calculation so completely that the consequence calculation
barely registers. That is why the saving tracked record count almost exactly, and it is also a
useful general warning: the intuition that “the interesting records are the expensive ones” is worth
checking rather than assuming, and here it was simply false.&lt;/p&gt;

&lt;p&gt;The arithmetic is then worth doing honestly, because the headline number is smaller than the naive
prediction. Amdahl on the profile says: 9.0 minutes of untouchable work plus 293.0/38.5 = 7.6 minutes
of annotation, which is 16.6 minutes, an 18.2x speed-up. The measured filter-only figure is 13.7x.
The gap is the filtering pass itself, which still has to decompress and read all 26,584,113 records —
you cannot skip records without looking at them — and which costs 5.5 minutes that Amdahl on the
original profile does not know about. Tuning the annotator then recovered 1.41x on the annotation
stage alone (7.6 minutes down to 5.4), which is worth only 1.11x on the total, because by that point
the total is dominated by the 14.5 minutes of filtering and post-processing that tuning does not
touch. 13.7x to 15.2x. Anyone quoting 38x from the record ratio alone has forgotten both the residual
3% and the cost of the skip.&lt;/p&gt;

&lt;h2 id=&quot;two-parameters-that-only-turned-up-in-a-sweep&quot;&gt;Two parameters that only turned up in a sweep&lt;/h2&gt;

&lt;p&gt;Neither of these would have been found by reasoning. Both came out of running the same 690,412-record
file across a grid.&lt;/p&gt;

&lt;p&gt;Fork count, at a buffer of 50,000, on a node with 48 physical cores otherwise idle:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fork&lt;/code&gt;&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;Wall&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;Speed-up vs 1&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;Parallel efficiency&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;19.0 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.00x&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;100%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;2&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;10.2 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.86x&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;93%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;4&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;5.4 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;3.52x&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;88%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;8&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;6.1 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;3.11x&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;39%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;12&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;7.9 min&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;2.41x&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;20%&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;There is a knee at four and a genuine regression beyond it, not a plateau. Eight forks is slower in
wall-clock terms than four while consuming twice the cores. My reading of the mechanism is that
forked workers hand results back to a single parent that has to collect them and re-emit records in
input order, so past a certain width the parent becomes the constraint and the workers wait on it —
but that is inference from the shape of the curve, not something I instrumented, and the knee may
well sit somewhere else for a different cache, a different record mix or a different VEP release.
What does transfer is the practical consequence: measure before widening, because on this stage
“give it more cores” made things worse, which is the opposite of the instinct that sends you to a
bigger node.&lt;/p&gt;

&lt;p&gt;Buffer size, at four forks:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;5,000 (the default): 7.6 min, 4.1 GB peak RSS&lt;/li&gt;
  &lt;li&gt;25,000: 5.9 min, 7.2 GB&lt;/li&gt;
  &lt;li&gt;50,000: 5.4 min, 11.6 GB&lt;/li&gt;
  &lt;li&gt;100,000: 5.4 min, 22.4 GB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1.41x from the default to 50,000, and nothing after that except memory. The buffer is how many
variants are held and processed as a batch, and a batch is resolved against the cache by region, so
a larger buffer means the same cache region is fetched and parsed fewer times. Once the buffer is
comfortably larger than the typical run of variants within one cache region, there is nothing left to
amortize, which is consistent with the flat line between 50,000 and 100,000. I am confident in the
measurement; the explanation is my reading of the behavior and not something I have confirmed
against the implementation.&lt;/p&gt;

&lt;p&gt;Memory is the real limit here, and it interacts with the next section: 11.6 GB per file times six
concurrent files is 70 GB, which fits on a 192 GB node; 22.4 GB times six does not leave room for
page cache, and buys nothing.&lt;/p&gt;

&lt;h2 id=&quot;concurrency-measured-rather-than-assumed&quot;&gt;Concurrency, measured rather than assumed&lt;/h2&gt;

&lt;p&gt;The stage is now short enough that per-file parallelism is not the interesting axis. Running several
files at once is. With four forks each, six concurrent files put 24 forked workers on a 48-core node,
plus six parent processes that are collecting and serializing rather than computing.&lt;/p&gt;

&lt;p&gt;Measured by running the identical file six times simultaneously and taking the wall time of each:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;one file alone: 19.9 min&lt;/li&gt;
  &lt;li&gt;six files concurrently: mean 20.9 min, slowest 21.0 min&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Per-file slowdown is 5%, so aggregate throughput is 95% of six times the single-file rate. Eight
concurrent files dropped to 82% efficiency, and the drop was in the annotation stage, not the filter
stage. Two explanations fit and I did not separate them: eight files is 32 workers plus eight
parents, which is 40 runnable processes on 48 cores and getting close enough to contend, and it is
also more concurrent readers against the same cache files, so page-cache pressure is equally
plausible. I would not present either as the cause.&lt;/p&gt;

&lt;p&gt;Scaled to a batch of roughly 210 samples on four nodes, at six files in flight per node — 24
concurrent, so nine waves with the last one part-empty — the baseline pipeline is about 45 hours of
wall time and the revised one is a little over three. Both figures are arithmetic over the per-sample
measurements above, not a full batch re-run at both settings, and the two sides are not measured
equally: the revised figure uses the 20.9-minute six-concurrent number, while the baseline figure
uses the 302-minute single-file number, because I never ran six baseline files at once. If the
baseline carries the same concurrency penalty, it is nearer 47 hours and the ratio is slightly better
than stated. Scale to your own sample count before quoting any of it — the wave arithmetic is lumpy,
and a batch that does not divide evenly into 24 lands worse than the ratio suggests.&lt;/p&gt;

&lt;h2 id=&quot;proving-the-output-is-identical&quot;&gt;Proving the output is identical&lt;/h2&gt;

&lt;p&gt;A 15x speed-up you cannot verify is a 15x speed-up you should not ship. Two properties need proving:
the same set of sites, and the same consequence calls at each site.&lt;/p&gt;

&lt;p&gt;The trap in the comparison is that the fast path normalizes and splits multi-allelic records and the
baseline does not, so a direct diff shows thousands of differences that are pure representation.
Normalize both sides identically before comparing, using the same reference and the same options:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bcftools norm &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-any&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; baseline.vep.vcf.gz &lt;span class=&quot;nt&quot;&gt;-Ou&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | bcftools view &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;ALT=&quot;&amp;lt;NON_REF&amp;gt;&quot; || ALT=&quot;*&quot;&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Oz&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; baseline.norm.vcf.gz
bcftools index &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; baseline.norm.vcf.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Site set, both directions:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bcftools isec -C -w1 baseline.norm.vcf.gz fast.vep.vcf.gz | grep -vc &apos;^#&apos;
0
$ bcftools isec -C -w1 fast.vep.vcf.gz baseline.norm.vcf.gz | grep -vc &apos;^#&apos;
0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Zero in both directions is the claim worth making. One direction alone proves nothing: a fast path
that emits a superset passes a one-way check.&lt;/p&gt;

&lt;p&gt;What &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;isec&lt;/code&gt; counts as “the same site” is worth knowing before you trust the zero. It defaults to
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--collapse none&lt;/code&gt;, under which only records with identical &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;REF&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT&lt;/code&gt; are compatible, so this
comparison is on alleles and not merely on positions. That is the strict reading and the one you
want. Had it defaulted to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;all&lt;/code&gt;, two records at the same coordinate with completely different alleles
would have matched and both directions would have read zero while the alleles disagreed.&lt;/p&gt;

&lt;p&gt;Consequence calls, by digest of the annotation payload rather than by eye:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ for f in baseline.norm.vcf.gz fast.vep.vcf.gz; do
    bcftools query -f &apos;%CHROM:%POS:%REF:%ALT\t%INFO/CSQ\n&apos; &quot;$f&quot; \
      | sort | sha256sum | awk -v f=&quot;$f&quot; &apos;{print f, $1}&apos;
  done
baseline.norm.vcf.gz  9f3c1b...e4a7
fast.vep.vcf.gz       9f3c1b...e4a7
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Compare the body, never the whole file: the headers differ legitimately because they record the
command line and the run time. And the digest comparison is only meaningful if both runs used the
same annotator version, the same cache version and the same options — a cache upgrade between the
two runs changes consequence calls for real reasons and will produce a mismatch that has nothing to
do with your filter. Pin both, and record both in the run log.&lt;/p&gt;

&lt;p&gt;A useful third check, cheap to run and independent of the first two:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ for f in baseline.norm.vcf.gz fast.vep.vcf.gz; do bcftools +counts &quot;$f&quot;; done
Number of samples: 1
Number of SNPs:    598204
Number of INDELs:  92208
Number of MNPs:    0
Number of others:  0
Number of sites:   690412
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Identical on both. 598,204 + 92,208 = 690,412, which also ties back to the pre-annotation count and
confirms nothing was added or lost inside the annotator.&lt;/p&gt;

&lt;p&gt;That sum only works because the records are biallelic. The plugin increments a counter for &lt;em&gt;every&lt;/em&gt;
variant type a record contains and increments the site counter once, so a multi-allelic record
carrying a SNV and an indel adds one to each of three counters. Run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;+counts&lt;/code&gt; on an unsplit file and
the categories over-sum against the site count, which looks like corruption and is not. The
cross-check is valid here because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;norm -m -any&lt;/code&gt; has already guaranteed one allele per record.&lt;/p&gt;

&lt;h2 id=&quot;the-caveat-that-limits-all-of-this&quot;&gt;The caveat that limits all of this&lt;/h2&gt;

&lt;p&gt;The waste removed here is a property of one file format. A per-sample genomic VCF describes every
callable position, so it is mostly reference blocks, so most of it is not annotatable. That is why
the filter works.&lt;/p&gt;

&lt;p&gt;A joint-called multi-sample VCF has no reference blocks at all. It stores sites — positions where
at least one sample in the cohort carries something — and every record in it has a real alternate
allele. There is no 97% to remove. Applying this filter to a joint callset gives you a full
decompression-and-parse pass over the file that removes nothing, which is a pure regression, and the
“records entering annotation” row of that table would read the same before and after. It will not
cost the 5.5 minutes quoted above — a joint callset has far fewer records than a per-sample gVCF, so
the pass is proportionally cheaper — but cheaper than useless is still useless.&lt;/p&gt;

&lt;p&gt;The equivalent saving on a joint callset exists but is on a completely different axis. The redundancy
there is across samples, not across positions: if you annotate N per-sample files independently, you
annotate the same common variants N times. The fix is to build one union site list, annotate it once,
and join the annotations back onto the per-sample files by position and allele:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bcftools merge &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; none &lt;span class=&quot;nt&quot;&gt;-Ou&lt;/span&gt; sample&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.sites.vcf.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | bcftools norm &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-any&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Oz&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; cohort.sites.vcf.gz
bcftools index &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; cohort.sites.vcf.gz

vep &lt;span class=&quot;nt&quot;&gt;--offline&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--cache&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--dir_cache&lt;/span&gt; /ref/vep &lt;span class=&quot;nt&quot;&gt;--assembly&lt;/span&gt; GRCh38 &lt;span class=&quot;nt&quot;&gt;--fasta&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REF&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--fork&lt;/span&gt; 4 &lt;span class=&quot;nt&quot;&gt;--buffer_size&lt;/span&gt; 50000 &lt;span class=&quot;nt&quot;&gt;--no_stats&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--vcf&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--allele_number&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; cohort.sites.vcf.gz &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; cohort.csq.vcf.gz &lt;span class=&quot;nt&quot;&gt;--compress_output&lt;/span&gt; bgzip
bcftools index &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; cohort.csq.vcf.gz

bcftools annotate &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; cohort.csq.vcf.gz &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; INFO/CSQ &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; sample.annotated.vcf.gz &lt;span class=&quot;nt&quot;&gt;-Oz&lt;/span&gt; sample.sites.vcf.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The join in that last command is the place it goes wrong. When the annotation file is a VCF,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bcftools annotate&lt;/code&gt; matches on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CHROM&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;POS&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;REF&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT&lt;/code&gt;, and a record that does not match is
left unannotated in silence — there is no warning and no non-zero exit. So both sides have to have
been normalized with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;norm -m -any&lt;/code&gt; against the &lt;em&gt;same&lt;/em&gt; reference FASTA, or a left-alignment
difference at a repeat-adjacent indel produces two records that a human would call the same variant
and bcftools will not. Check the join by counting records with a missing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CSQ&lt;/code&gt; afterwards rather than
assuming it landed. The annotation file also has to be bgzip-compressed and indexed, which is what
the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;index -t&lt;/code&gt; above is for.&lt;/p&gt;

&lt;p&gt;The scaling of that is set by the overlap between samples, not by the reference-block fraction, and
the overlap depends on cohort size and ancestry composition. I have not measured it carefully enough
to quote a factor, so I will not quote one.&lt;/p&gt;

&lt;p&gt;One last thing that is easy to get wrong at the end of a project like this. The filtered file is an
annotation &lt;em&gt;input&lt;/em&gt;, not a replacement for the gVCF. The reference blocks you removed are what
distinguishes “this sample has no variant here” from “this position was never callable in this
sample”, and that distinction is the entire reason the gVCF format exists. Keep the original. The
optimization is that the annotator never sees it.&lt;/p&gt;

&lt;h2 id=&quot;what-to-take-from-this&quot;&gt;What to take from this&lt;/h2&gt;

&lt;p&gt;Profile first, in stages, with timestamps that end up in a log someone else can read. If one stage is
97% of the cost, nothing you do to the other stages matters, and the only question worth asking about
that stage is whether the work it is doing needs doing at all.&lt;/p&gt;

&lt;p&gt;Then verify in both directions before you believe your own result, because the fastest version of any
pipeline is the one that quietly does less than it should, and it will pass every check that only
looks at how long it took.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Nsight Systems and Nsight Compute: explain GPU stalls without misreading the counters</title>
    <link href="https://www.wirewalk.com/writing/nsight-systems-compute-cache-core-analysis/"/>
    <published>2026-06-18T10:00:00-04:00</published>
    <updated>2026-06-18T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nsight-systems-compute-cache-core-analysis/</id>
    <summary>Move from application timelines to targeted kernel counters, accounting for replay, cache state, occupancy and shared-resource effects before changing CUDA code.</summary>
    <content type="html">&lt;p&gt;A kernel can become faster while the training step barely changes. It may contribute little to elapsed time, or the change may expose a host, communication or storage delay that the original analysis never measured.&lt;/p&gt;

&lt;p&gt;Start with the application timeline and choose a meaningful interval. Then collect counters for a specific kernel invocation. Nsight Systems and Nsight Compute answer different parts of that investigation, and the measurement conditions need to travel with their reports.&lt;/p&gt;

&lt;h2 id=&quot;find-where-elapsed-time-is-actually-spent&quot;&gt;Find where elapsed time is actually spent&lt;/h2&gt;

&lt;p&gt;Measure the application without profiling first. Record input, iteration count, warm-up policy and the output used to verify correctness. Retain both end-to-end time and a representative steady-state interval.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.nvidia.com/nsight-systems/UserGuide/index.html&quot;&gt;Nsight Systems&lt;/a&gt; provides the execution timeline needed to locate host gaps, CUDA activity, transfers and supported annotations. A bounded example is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nsys profile &lt;span class=&quot;nt&quot;&gt;--trace&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;cuda,nvtx &lt;span class=&quot;nt&quot;&gt;--sample&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;none &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;solver-timeline ./solver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This example omits CPU sampling to keep the initial collection focused. Adapt the trace configuration and duration to the installed release. A full production run can produce excessive data and substantial overhead; a selected reproducing interval is usually more useful.&lt;/p&gt;

&lt;p&gt;Add NVTX ranges around meaningful application phases when source changes are possible. Label work by its role in the experiment rather than giving every tiny function a range. The objective is to connect a slow step to the activity that delayed it.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-waiting-on-the-host-from-slow-execution-on-the-device&quot;&gt;Distinguish waiting on the host from slow execution on the device&lt;/h2&gt;

&lt;p&gt;Look for periods when the GPU lacks work and for periods when work is present but completion is slow. Host-side API duration, queued GPU work and device execution duration are different measurements. A long synchronization call can simply be the place the host waits for earlier work.&lt;/p&gt;

&lt;p&gt;Inspect transfer overlap and stream dependencies. Confirm whether the application actually offers independent work before concluding that a scheduling mechanism failed to overlap it. A serial producer cannot be repaired by raising a GPU utilization target.&lt;/p&gt;

&lt;p&gt;For multi-rank applications, compare timelines from the relevant ranks with synchronized context and explicit clock assumptions. One late rank can turn collective time into the visible symptom of a CPU or data-loading delay elsewhere.&lt;/p&gt;

&lt;h2 id=&quot;select-one-invocation-before-collecting-many-counters&quot;&gt;Select one invocation before collecting many counters&lt;/h2&gt;

&lt;p&gt;Use the timeline to identify the important kernel, its input scale and whether it occurs during warm-up or steady state. Collect a small initial metric set with Nsight Compute, then expand only when a specific hypothesis requires it.&lt;/p&gt;

&lt;p&gt;An illustrative collection is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ncu &lt;span class=&quot;nt&quot;&gt;--set&lt;/span&gt; basic &lt;span class=&quot;nt&quot;&gt;--launch-count&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;--export&lt;/span&gt; kernel-pass ./solver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This selects one launch according to the tool’s current selection rules; it does not know which launch matters to the research workload. Use the installed version’s kernel filters, launch selection or range facilities to target the invocation identified in the timeline. Save those settings with the result.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.nvidia.com/nsight-compute/ProfilingGuide/index.html&quot;&gt;Nsight Compute profiling guide&lt;/a&gt; explains why collection may require replay. A profiled invocation can execute under conditions that differ from normal concurrent application execution.&lt;/p&gt;

&lt;h2 id=&quot;preserve-replay-and-cache-policy-in-comparisons&quot;&gt;Preserve replay and cache policy in comparisons&lt;/h2&gt;

&lt;p&gt;Hardware counters cannot all necessarily be collected in one pass. Replay and the associated cache handling affect what a reported access pattern means. Record the replay mode, cache-control setting, metric selection and clock behavior.&lt;/p&gt;

&lt;p&gt;A warm cache in the ordinary application and a flushed cache in profiling can produce different results without either measurement being defective. Decide which experiment you need. If the hypothesis concerns inter-kernel reuse, use a supported collection method that preserves the relevant context and validate it against the uninstrumented timeline.&lt;/p&gt;

&lt;p&gt;Do not compare a cache-hit ratio from one replay policy with a bandwidth figure from another and present the combination as a single observed execution. Keep related measurements in a coherent collection configuration, with limitations stated.&lt;/p&gt;

&lt;h2 id=&quot;interpret-cache-behavior-through-traffic-and-useful-work&quot;&gt;Interpret cache behavior through traffic and useful work&lt;/h2&gt;

&lt;p&gt;A low cache-hit rate can be expected for a streaming workload. A high hit rate can coexist with a slow kernel if dependencies, instruction throughput or synchronization dominate. Ask how much data is transferred for each useful output and which level serves it.&lt;/p&gt;

&lt;p&gt;Examine access layout and request efficiency before proposing a larger cache as the remedy. Uncoalesced accesses or unnecessary intermediate arrays can increase traffic independently of dataset size. A cache optimization that reduces traffic but increases instructions or register demand needs an end-to-end check.&lt;/p&gt;

&lt;p&gt;Use the relevant &lt;a href=&quot;https://docs.nvidia.com/cuda/archive/12.8.0/cuda-c-best-practices-guide/index.html&quot;&gt;CUDA best-practices guidance&lt;/a&gt; for the target architecture. Avoid carrying one GPU’s metric names or memory hierarchy assumptions into another generation without review.&lt;/p&gt;

&lt;h2 id=&quot;treat-occupancy-as-a-constraint-not-a-score&quot;&gt;Treat occupancy as a constraint, not a score&lt;/h2&gt;

&lt;p&gt;Occupancy describes the residency of active warps relative to supported capacity under specified conditions. It does not directly measure useful issue rate, instruction efficiency or application throughput. Increasing it can help hide latency, but can also change register pressure, shared-memory use and spilling.&lt;/p&gt;

&lt;p&gt;Inspect why residency is limited and whether the kernel has enough independent work to benefit. Reducing registers merely to improve an occupancy number may create extra local-memory traffic. Compare the changed kernel’s actual duration and correctness with its original behavior.&lt;/p&gt;

&lt;p&gt;Similarly, a stall category identifies an observation in the processor’s execution machinery. It is a lead for investigation, not a source-code fix by itself. Connect it to the hot instruction sequence, data dependency or synchronization pattern before rewriting the algorithm.&lt;/p&gt;

&lt;h2 id=&quot;revalidate-outside-the-profiler&quot;&gt;Revalidate outside the profiler&lt;/h2&gt;

&lt;p&gt;Run the original and changed application under matched allocation, placement and software conditions. Alternate selected runs to expose warming and background-load effects. Report variation rather than just the best time.&lt;/p&gt;

&lt;p&gt;Measure a neighboring workload where shared GPUs or other shared resources are part of the service. A kernel improvement that consumes more memory bandwidth can change another user’s latency even if its own execution improves.&lt;/p&gt;

&lt;p&gt;Keep a compact analysis record: application phase, selected invocation, profiler settings, supporting counters, proposed cause, code change and unprofiled outcome. For the correctness checks that precede this process, see &lt;a href=&quot;/writing/cuda-gdb-compute-sanitizer-correctness/&quot;&gt;CUDA-GDB and Compute Sanitizer&lt;/a&gt;. Hardware analysis becomes useful when it explains the application’s behavior under its real operating conditions.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>BCM image drift: prove what a node will boot before updating the fleet</title>
    <link href="https://www.wirewalk.com/writing/bcm-image-drift-release-validation/"/>
    <published>2026-06-12T10:00:00-04:00</published>
    <updated>2026-06-12T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/bcm-image-drift-release-validation/</id>
    <summary>A practical release process for BCM images: separate desired configuration from running state, inspect synchronization scope, and qualify a reboot before rolling changes outward.</summary>
    <content type="html">&lt;p&gt;A package fix on one compute node can make an application work immediately and disappear at the next provision. The reverse is just as frustrating: the image contains the fix, but researchers keep landing on nodes that have never received it. Both situations look like an intermittent application problem until someone compares the running system with the image assigned to it.&lt;/p&gt;

&lt;p&gt;Base Command Manager gives you mechanisms for managing images and updating nodes. The operating process still has to establish which state is authoritative, what a synchronization will touch, and what survives boot. This article uses BCM 10 terminology; command options and exclusion rules must be checked against the installed point release.&lt;/p&gt;

&lt;h2 id=&quot;keep-three-inventories-instead-of-one-reassuring-label&quot;&gt;Keep three inventories instead of one reassuring label&lt;/h2&gt;

&lt;p&gt;Record the assigned software image, the contents of that image, and the running node state separately. An image name is an administrative reference, not a content digest. Editing an image in place can leave two nodes with the same assigned name and different packages, kernels or configuration.&lt;/p&gt;

&lt;p&gt;For each release, retain a package manifest, a short list of critical configuration hashes and the intended boot kernel. Include GPU driver packages, RDMA components, filesystem clients and scheduler plugins. Keep secrets out of the manifest. For generated configuration, record the generator and its inputs rather than storing credentials in a checksum report.&lt;/p&gt;

&lt;p&gt;A small read-only inventory on an RPM-based node might begin with:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;uname&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;
rpm &lt;span class=&quot;nt&quot;&gt;-qa&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--qf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;%{NAME} %{VERSION}-%{RELEASE}.%{ARCH}\n&apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sort
&lt;/span&gt;findmnt &lt;span class=&quot;nt&quot;&gt;-rn&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; TARGET,FSTYPE,SOURCE
systemctl &lt;span class=&quot;nt&quot;&gt;--failed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--no-pager&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These observations describe the node where they run. Collect the image manifest inside the image using the package manager’s supported root or chroot workflow. A successful package transaction there does not establish that a kernel module will load on the next boot.&lt;/p&gt;

&lt;h2 id=&quot;decide-which-mechanism-owns-each-file&quot;&gt;Decide which mechanism owns each file&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.nvidia.com/base-command-manager/product-manuals/10/admin/softwareimagemanagement&quot;&gt;NVIDIA’s BCM 10 software-management documentation&lt;/a&gt; describes image management, package changes and node-to-image synchronization. Use it to identify the supported operation for the intended direction of change.&lt;/p&gt;

&lt;p&gt;Assign a clear owner to each configuration area. The image may own installed binaries, BCM may generate network settings, and a separate configuration system may manage a service policy. If all three rewrite the same file, a node can alternate between apparently valid states depending on which agent ran last.&lt;/p&gt;

&lt;p&gt;Build a table with path, owner, regeneration trigger and expected local exception. A locally generated SSH host key has a different lifecycle from a shared scheduler configuration. A dataset staged on local scratch has a different retention rule from an operating-system cache. Neither belongs in a generic instruction to make the node identical to the image.&lt;/p&gt;

&lt;p&gt;Avoid capturing a repaired node wholesale without reviewing its state. It may contain temporary certificates, user material, troubleshooting flags or a configuration that only makes sense on that machine. Transfer the deliberate change into the controlled image and rebuild its manifest.&lt;/p&gt;

&lt;h2 id=&quot;review-synchronization-as-a-proposed-change&quot;&gt;Review synchronization as a proposed change&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.nvidia.com/base-command-manager/product-manuals/10/admin/provisioning&quot;&gt;BCM 10 provisioning chapter&lt;/a&gt; is the reference for image-to-node updates and their scope. Before an update, inspect the installed tool’s dry-run and synchronization-log facilities. Read proposed deletions as carefully as replacements.&lt;/p&gt;

&lt;p&gt;Use a disposable directory containing a harmless sentinel to check the treatment of a local exception. Do this on a canary with no research data at risk. A policy saying that a path is excluded is weaker evidence than a preview showing it untouched and a subsequent test confirming that outcome.&lt;/p&gt;

&lt;p&gt;Pay attention to files that require a service restart or reboot. Replacing a library on disk does not replace the copy already mapped into a process. Kernel, initramfs, driver and userspace changes can produce a mixed state that never exists after a clean boot. Document whether the release supports live synchronization, reboot provisioning or both.&lt;/p&gt;

&lt;h2 id=&quot;qualify-the-booted-release&quot;&gt;Qualify the booted release&lt;/h2&gt;

&lt;p&gt;Keep the canary unavailable to ordinary jobs while testing. Confirm its assigned image, provision it through the intended path, and read back the booted kernel and loaded modules. Then exercise the workload path: authentication, mounts, a scheduler allocation, CPU placement, GPU access if present, and communication to another qualified node.&lt;/p&gt;

&lt;p&gt;For NVIDIA systems, separate driver visibility from application readiness. A successful inventory query is useful, but a short CUDA allocation, representative container and relevant multi-node test cover different dependencies. A node can see its GPU while its container cannot use the intended libraries.&lt;/p&gt;

&lt;p&gt;Retain the previous image and a way to reach the canary out of band. Reverting an image assignment is only part of rollback: establish how the node actually boots it, how much local state is lost, and which services must be revalidated afterward.&lt;/p&gt;

&lt;h2 id=&quot;treat-exceptions-as-expiring-work&quot;&gt;Treat exceptions as expiring work&lt;/h2&gt;

&lt;p&gt;Some local changes are justified. A diagnostic agent may need a temporary override, or a hardware fault may require one node to use a different package. Record an owner and expiry condition for each exception. Otherwise every repair becomes a permanent fork with no name.&lt;/p&gt;

&lt;p&gt;Roll out in small groups selected across relevant hardware classes. Watch for recurring differences in manifests, boot duration and workload checks. Stop if a second node reproduces an unexplained failure; adding more nodes rarely clarifies whether the problem comes from the image or the update process.&lt;/p&gt;

&lt;p&gt;The useful release record is concise: image identity, manifest, canary evidence, rollout population and rollback result. Another administrator should be able to tell what a node will become after provisioning without remembering the terminal session that created the image.&lt;/p&gt;

&lt;p&gt;For the state that deliberately stays outside an image, see &lt;a href=&quot;/writing/node-local-state-and-the-reimage-that-erases-it/&quot;&gt;node-local state and reimaging&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>PyTorch DataLoader bottlenecks on HPC GPU clusters</title>
    <link href="https://www.wirewalk.com/writing/pytorch-dataloader-bottlenecks-hpc-gpu-training/"/>
    <published>2026-06-12T00:00:00-04:00</published>
    <updated>2026-10-18T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/pytorch-dataloader-bottlenecks-hpc-gpu-training/</id>
    <summary>Diagnose slow PyTorch data loading on HPC clusters with per-rank timing, worker sweeps, storage checks, and reproducible GPU throughput measurements.</summary>
    <content type="html">&lt;p&gt;Before adding GPUs to a slow training job, measure how long each step waits for a batch. The delay may be in storage, CPU preprocessing or transfer to the device, while the model itself runs quickly.&lt;/p&gt;

&lt;p&gt;Use representative data and the documentation for the installed PyTorch release. The comparisons below are diagnostic experiments, not reported benchmark results.&lt;/p&gt;

&lt;h2 id=&quot;separate-the-input-pipeline-from-model-execution&quot;&gt;Separate the input pipeline from model execution&lt;/h2&gt;

&lt;p&gt;Start with three runs using the same model, batch size, precision and device placement:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Reuse a prepared batch already on the GPU. This estimates the model execution ceiling for that batch shape.&lt;/li&gt;
  &lt;li&gt;Reuse prepared batches in host memory. This introduces host-to-device transfer.&lt;/li&gt;
  &lt;li&gt;Read and transform the real dataset. This introduces filesystem access, decoding, augmentation and worker coordination.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The gaps identify where to investigate; they are not additive costs because stages can overlap. Keep the real run long enough to expose cache exhaustion and periodic stalls. Record warmup separately.&lt;/p&gt;

&lt;p&gt;PyTorch’s &lt;a href=&quot;https://docs.pytorch.org/tutorials/recipes/recipes/tuning_guide&quot;&gt;performance tuning guide&lt;/a&gt; documents worker subprocesses and pinned memory as ways to overlap preparation and transfers. Neither guarantees that your workload gets faster.&lt;/p&gt;

&lt;h2 id=&quot;measure-batch-wait-and-step-time-correctly&quot;&gt;Measure batch wait and step time correctly&lt;/h2&gt;

&lt;p&gt;Time how long the training process waits for the next batch and compare it with end-to-end step time. CUDA operations are asynchronous, so CPU timing around a model call alone does not measure completed GPU work. Use a profiler or CUDA events for GPU regions. For a short diagnostic measurement, synchronize at the boundaries; avoid leaving forced synchronization in the production loop because it changes overlap.&lt;/p&gt;

&lt;p&gt;Report median and tail latency, not only the mean. Periodic long waits can dominate time to solution even when most batches arrive promptly. Use the &lt;a href=&quot;https://docs.pytorch.org/docs/stable/profiler.html&quot;&gt;PyTorch profiler&lt;/a&gt; to inspect CPU activity, GPU work and transfers together.&lt;/p&gt;

&lt;p&gt;In distributed training, collect timings per rank. One process that receives batches late can hold up the others at synchronization. A healthy aggregate storage rate can coexist with one slow reader.&lt;/p&gt;

&lt;h2 id=&quot;tune-workers-within-the-slurm-cpu-allocation&quot;&gt;Tune workers within the Slurm CPU allocation&lt;/h2&gt;

&lt;p&gt;Sweep a small set of worker counts while holding everything else fixed. Count workers across every training process on the node: eight ranks with four workers each create 32 loader workers, in addition to the ranks and any library threads.&lt;/p&gt;

&lt;p&gt;Check the CPU allocation, affinity and actual CPU use before increasing concurrency. More workers can increase context switching, memory consumption and pressure on shared storage. Limit nested numerical-library threading when it competes with the loader, then measure again.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.pytorch.org/docs/stable/data.html&quot;&gt;DataLoader reference&lt;/a&gt; explains worker count, prefetching, persistent workers and memory pinning. Test these options individually. Persistent workers may reduce epoch startup overhead, but worker state and random-seed behavior still need attention. Prefetch depth consumes memory; it is a buffer, not additional storage bandwidth.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-metadata-pressure-from-bandwidth&quot;&gt;Distinguish metadata pressure from bandwidth&lt;/h2&gt;

&lt;p&gt;A dataset containing many small files can stress metadata and file-open operations while moving relatively few bytes. A sequential read test does not reproduce that workload.&lt;/p&gt;

&lt;p&gt;Compare representative access patterns: file sizes, randomization, number of readers, transforms, and cache state. Observe storage latency and metadata activity alongside throughput. If changing the data layout is feasible, evaluate a sharded format with the same samples and shuffle semantics. Larger shards can reduce file-open overhead, but shard assignment and shuffle quality become part of the experiment.&lt;/p&gt;

&lt;p&gt;Node-local staging is another experiment. Include staging time in the result and verify capacity, cleanup and data-access policy. A faster training loop that first copies the entire dataset may take longer for a short job.&lt;/p&gt;

&lt;h2 id=&quot;check-pinned-memory-and-host-to-device-overlap&quot;&gt;Check pinned memory and host-to-device overlap&lt;/h2&gt;

&lt;p&gt;Pinned host memory can support faster transfers and asynchronous copies, but it occupies host RAM. Combine it with transfer behavior that actually allows overlap, and inspect the timeline rather than assuming an option enabled it.&lt;/p&gt;

&lt;p&gt;Watch host memory and shared-memory use, especially in containers and multi-worker jobs. A worker failure or memory limit can look like an intermittent input stall. Keep a simple single-worker configuration available for diagnosis.&lt;/p&gt;

&lt;h2 id=&quot;publish-a-reproducible-result&quot;&gt;Publish a reproducible result&lt;/h2&gt;

&lt;p&gt;Record samples or useful tokens per second, step-time distribution, batch wait per rank, worker count per rank, CPU allocation, host memory, dataset layout, cache conditions and software versions. Include startup and staging costs when reporting job completion time.&lt;/p&gt;

&lt;p&gt;Compare wall-clock time for the same samples and training semantics after each change. A higher GPU busy percentage is encouraging only if the training work finishes sooner.&lt;/p&gt;

&lt;p&gt;Continue with &lt;a href=&quot;/writing/reading-gpu-utilization-mfu-honestly/&quot;&gt;GPU utilization and model FLOPs utilization&lt;/a&gt;, &lt;a href=&quot;/writing/ior-mdtest-parallel-storage/&quot;&gt;IOR and mdtest storage benchmarking&lt;/a&gt;, and &lt;a href=&quot;/writing/slurm-efficiency-accounting-traps/&quot;&gt;Slurm efficiency accounting&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Distributed AI checkpoints: storage performance and restart testing</title>
    <link href="https://www.wirewalk.com/writing/distributed-ai-checkpoint-storage-restart-testing/"/>
    <published>2026-06-10T00:00:00-04:00</published>
    <updated>2026-10-18T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/distributed-ai-checkpoint-storage-restart-testing/</id>
    <summary>Measure distributed AI checkpoint stalls, storage contention, and restart time. Validate recoverable training state before tuning asynchronous saves.</summary>
    <content type="html">&lt;p&gt;Try loading the checkpoint in a fresh allocation before relying on it. A directory of shards or a fast save call will not tell you whether training can resume, particularly after the original workers and their local state are gone.&lt;/p&gt;

&lt;p&gt;For distributed training, follow the saved state from capture through persistence, discovery and restore. The procedure below proposes recovery tests; it does not report measured product performance.&lt;/p&gt;

&lt;h2 id=&quot;define-the-failure-the-checkpoint-must-survive&quot;&gt;Define the failure the checkpoint must survive&lt;/h2&gt;

&lt;p&gt;State whether the objective is surviving a process crash, a failed GPU node, loss of node-local storage, or loss of a shared filesystem. A checkpoint on local NVMe can help with some restarts while disappearing with the node it is meant to protect.&lt;/p&gt;

&lt;p&gt;List the training state required for the intended restart. Depending on the framework and workflow, that can include model parameters, optimizer and scheduler state, step counters, random-number state and data-sampling progress. Model weights alone are not necessarily sufficient to continue the same training trajectory.&lt;/p&gt;

&lt;p&gt;PyTorch’s &lt;a href=&quot;https://docs.pytorch.org/tutorials/recipes/distributed_checkpoint_recipe.html&quot;&gt;distributed checkpoint tutorial&lt;/a&gt; describes parallel saving and loading across ranks. Check the supported state representation and restore procedure for your installed release and training strategy before choosing a format.&lt;/p&gt;

&lt;h2 id=&quot;measure-stall-time-separately-from-persistence-time&quot;&gt;Measure stall time separately from persistence time&lt;/h2&gt;

&lt;p&gt;There are at least three useful measurements:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Training stall:&lt;/strong&gt; how long useful training pauses to capture or stage state.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Save completion:&lt;/strong&gt; how long the checkpoint operation takes to finish writing through its storage interface.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Restart time:&lt;/strong&gt; how long a fresh job takes to locate, load and resume from the selected checkpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Storage API completion does not by itself prove survival of every storage-system failure. Document the filesystem or object-store guarantees and the failure boundary you actually tested.&lt;/p&gt;

&lt;p&gt;For asynchronous saving, record when the operation starts and when its completion result is observed. A short foreground call can hide substantial background I/O. Watch training step time while the write continues, because the checkpoint can compete for CPU, host memory, network and storage bandwidth.&lt;/p&gt;

&lt;h2 id=&quot;treat-asynchronous-saves-as-bounded-work&quot;&gt;Treat asynchronous saves as bounded work&lt;/h2&gt;

&lt;p&gt;PyTorch’s &lt;a href=&quot;https://docs.pytorch.org/tutorials/recipes/distributed_async_checkpoint_recipe.html&quot;&gt;asynchronous checkpoint recipe&lt;/a&gt; describes the memory overhead of staging and demonstrates waiting for the previous save before starting another. Use a bounded number of outstanding saves appropriate to the installed API and memory budget.&lt;/p&gt;

&lt;p&gt;If saves take longer than the checkpoint interval, launching more saves can build a backlog rather than improve protection. Record which checkpoint has actually completed, handle completion errors, and ensure the final pending operation finishes before an orderly job exit.&lt;/p&gt;

&lt;p&gt;A process killed during staging or writing must not cause the next job to select incomplete state. Use the framework’s supported completion and discovery mechanism. For a custom format, define a completion protocol that all writers and readers follow, and test it under interruption; the existence of a directory is insufficient.&lt;/p&gt;

&lt;h2 id=&quot;benchmark-the-shared-filesystem-under-realistic-concurrency&quot;&gt;Benchmark the shared filesystem under realistic concurrency&lt;/h2&gt;

&lt;p&gt;Test the intended rank and node counts. A single sequential writer cannot predict a distributed checkpoint with many shards and metadata operations. Measure per-rank completion times and the slowest participant, together with storage throughput and latency.&lt;/p&gt;

&lt;p&gt;Include other representative jobs in a controlled contention test when possible. A checkpoint configuration that achieves excellent isolated bandwidth can still cause unacceptable stalls for neighboring training jobs.&lt;/p&gt;

&lt;p&gt;For capacity planning, distinguish logical checkpoint size from actual bytes written, retained generations and temporary space. Compression, deduplication, replication and erasure coding change different layers of that accounting. Use observed storage consumption rather than assuming every layer reports the same number.&lt;/p&gt;

&lt;h2 id=&quot;run-the-restart-test-in-a-fresh-allocation&quot;&gt;Run the restart test in a fresh allocation&lt;/h2&gt;

&lt;p&gt;Use a disposable training run and separate checkpoint namespace. Never interrupt a production job merely to demonstrate this procedure.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Save a known step and confirm completion through the framework.&lt;/li&gt;
  &lt;li&gt;Terminate the disposable job, then start a fresh allocation without relying on its previous process memory or temporary files.&lt;/li&gt;
  &lt;li&gt;Restore the documented state and verify the resumed step, optimizer/scheduler state and data progress as applicable.&lt;/li&gt;
  &lt;li&gt;Run further steps and check expected training behavior within the workflow’s numerical tolerances.&lt;/li&gt;
  &lt;li&gt;Interrupt a later save and confirm that recovery selects the last complete checkpoint or reports a clear failure.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If recovery after a changed world size is a requirement, test that exact configuration. Do not infer support for a new sharding layout from success with the original rank count. Preserve the runtime and dependency information needed to read retained checkpoints; portability across software versions needs its own test.&lt;/p&gt;

&lt;h2 id=&quot;choose-an-interval-from-measured-costs&quot;&gt;Choose an interval from measured costs&lt;/h2&gt;

&lt;p&gt;Shorter intervals reduce the amount of completed work exposed to loss, but add save overhead and storage load. Longer intervals do the reverse. Base the choice on measured stall and restart times, the tolerated loss of progress, capacity and the failures the system needs to withstand.&lt;/p&gt;

&lt;p&gt;Report the interval, checkpoint size, rank count, foreground stall, full completion time, contention impact, retained generations and fresh-allocation restore time. Use those measurements to choose the interval, including the work lost during failure and the time needed to restart.&lt;/p&gt;

&lt;p&gt;Related guides: &lt;a href=&quot;/writing/ior-mdtest-parallel-storage/&quot;&gt;parallel storage benchmarking with IOR and mdtest&lt;/a&gt;, &lt;a href=&quot;/writing/verifying-multi-terabyte-transfer-checksums/&quot;&gt;multi-terabyte checksum verification&lt;/a&gt;, and &lt;a href=&quot;/writing/node-local-state-and-the-reimage-that-erases-it/&quot;&gt;what node reimaging erases&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>DCGM monitoring: connect GPU telemetry to the job that produced it</title>
    <link href="https://www.wirewalk.com/writing/dcgm-gpu-telemetry-job-attribution/"/>
    <published>2026-06-07T10:00:00-04:00</published>
    <updated>2026-06-07T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/dcgm-gpu-telemetry-job-attribution/</id>
    <summary>Build a GPU monitoring pipeline that preserves device identity, sampling meaning and job boundaries, then handles unsupported or missing values honestly.</summary>
    <content type="html">&lt;p&gt;A graph showing a busy GPU is useful only if you can identify the device, the time interval and the work that used it. Otherwise a researcher can be charged with another job’s activity, or an administrator can investigate a utilization drop that was actually a monitoring gap.&lt;/p&gt;

&lt;p&gt;NVIDIA DCGM supplies device telemetry, health and profiling facilities. The surrounding monitoring system must preserve their meaning as samples travel through an exporter, time-series database and dashboard. This article concentrates on that data contract rather than choosing an attractive set of panels.&lt;/p&gt;

&lt;h2 id=&quot;give-every-measurement-an-identity-and-a-clock&quot;&gt;Give every measurement an identity and a clock&lt;/h2&gt;

&lt;p&gt;Keep the physical GPU UUID, node identity and collector identity with the sample. A device index such as GPU 0 is convenient within a running node, but it is not a durable fleet-wide identifier. Record inventory changes so a replacement accelerator is not silently merged with the history of the device it replaced.&lt;/p&gt;

&lt;p&gt;For MIG, retain both the parent GPU and instance identity when the installed stack exposes them. Treat layout recreation as an inventory change. Historical attribution must not assume that an instance number always refers to the same resource.&lt;/p&gt;

&lt;p&gt;Separate observation time from ingestion time. If a collector buffers samples while its network path is unavailable, later ingestion does not make those samples current. Track scrape health and sample age alongside device measurements. Use synchronized clocks and retain enough timing information to recognize uncertainty around allocation boundaries.&lt;/p&gt;

&lt;h2 id=&quot;choose-a-small-set-of-questions-first&quot;&gt;Choose a small set of questions first&lt;/h2&gt;

&lt;p&gt;Start with the operational questions: is a device missing, is a job making progress, is temperature or power constraining behavior, and are errors increasing? Then decide which supported fields can help answer each question.&lt;/p&gt;

&lt;p&gt;Do not enable every profiling field merely because the exporter can list it. Check hardware and software support, permissions, collection cost and compatibility between metric groups. Unsupported data needs an explicit unavailable state, not a numeric zero that looks like a healthy idle device.&lt;/p&gt;

&lt;p&gt;The archived &lt;a href=&quot;https://docs.nvidia.com/datacenter/dcgm/3.1/user-guide/feature-overview.html&quot;&gt;DCGM 3.1 feature overview&lt;/a&gt; provides a useful reference for the established distinction between health, telemetry and profiling. Match the field semantics to the version actually installed rather than assuming a current field catalog applies to an older host engine.&lt;/p&gt;

&lt;h2 id=&quot;correlate-with-allocation-intervals&quot;&gt;Correlate with allocation intervals&lt;/h2&gt;

&lt;p&gt;Build a timeline of which job owned each device and when. Use scheduler allocation events or a supported integration that maintains that mapping. Usernames, current process lists and the latest allocation snapshot are not adequate historical records on their own.&lt;/p&gt;

&lt;p&gt;At a job boundary, a monitoring interval can overlap two owners. Decide how the pipeline handles that interval: exclude it from per-job summaries, mark it as mixed, or use a documented attribution method. A precise-looking decimal does not fix an ambiguous boundary.&lt;/p&gt;

&lt;p&gt;For shared GPUs, distinguish physical-device measurements from measurements that can actually be attributed to an instance or process. Assigning a whole-device power reading independently to every sharing job double-counts the same observation. A model for distributing shared cost is an accounting policy and should be labeled as such.&lt;/p&gt;

&lt;h2 id=&quot;keep-sampling-and-aggregation-explicit&quot;&gt;Keep sampling and aggregation explicit&lt;/h2&gt;

&lt;p&gt;A one-second sample and a five-minute average can tell different stories. Short stalls disappear inside long windows; low-frequency sampling can miss brief bursts. Retain the collection interval and the aggregation rule in the dashboard description.&lt;/p&gt;

&lt;p&gt;When comparing two runs, align the phases. Startup, data loading, training, validation and checkpointing can have very different device behavior. Compare a representative steady-state interval as well as end-to-end elapsed time. Averaging the entire allocation can hide whether a faster training loop was offset by a slower input stage.&lt;/p&gt;

&lt;p&gt;For counters, handle resets before calculating rates. A negative difference after a node reboot is not negative traffic. Preserve restart and inventory events so the pipeline can break the series at a meaningful point. For gauges, do not sum values across time unless the units and desired quantity justify that operation.&lt;/p&gt;

&lt;h2 id=&quot;validate-the-pipeline-with-known-behavior&quot;&gt;Validate the pipeline with known behavior&lt;/h2&gt;

&lt;p&gt;Use a qualified node and a small controlled workload. Observe an idle interval, a compute-heavy phase, a transfer phase and application shutdown. Confirm that expected samples arrive with the right device and time labels. The goal is validating the pipeline, not claiming that one synthetic load reproduces production training.&lt;/p&gt;

&lt;p&gt;Inspect the raw exporter output and stored series before debugging the graph. A dashboard can display the wrong unit perfectly. Check for stale label mappings, duplicate collectors and multiple series representing the same device.&lt;/p&gt;

&lt;p&gt;Read-only inventory commands help establish the reference:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvidia-smi &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;
dcgmi discovery &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
dcgmi &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These do not authorize active diagnostics on a busy node. Keep potentially intrusive tests in a maintenance allocation and use the installed DCGM documentation to understand their scope.&lt;/p&gt;

&lt;h2 id=&quot;coordinate-profiling-ownership&quot;&gt;Coordinate profiling ownership&lt;/h2&gt;

&lt;p&gt;A developer profiler and continuous monitoring can contend for hardware-counter resources. Establish how a profiling session is requested, what collection is paused where required, and how monitoring is restored. A global monitoring change should not be hidden inside an individual user’s shell setup.&lt;/p&gt;

&lt;p&gt;Record intentional gaps as maintenance events. Otherwise the monitoring team may treat the absence as a collector failure, while the application team assumes the metric means no work occurred. Test that the normal collection path returns after the profiling session exits unsuccessfully as well as after success.&lt;/p&gt;

&lt;h2 id=&quot;make-alerts-require-enough-evidence-to-act&quot;&gt;Make alerts require enough evidence to act&lt;/h2&gt;

&lt;p&gt;Alert on sustained, attributable conditions with a useful response. A missing GPU, repeated error growth or a collector that stopped reporting may justify different owners and urgency. Do not automatically drain a node because one utilization sample is low.&lt;/p&gt;

&lt;p&gt;Attach the device identity, interval, relevant job mapping and recent inventory events to the alert. A responder should be able to distinguish a hardware problem from an exporter restart without rebuilding the timeline manually.&lt;/p&gt;

&lt;p&gt;Use &lt;a href=&quot;/writing/reading-gpu-utilization-mfu-honestly/&quot;&gt;GPU utilization and useful work&lt;/a&gt; alongside this monitoring contract. Reliable telemetry can tell you what the device was doing; application progress is still needed to decide whether the research benefited.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Slurm checkpoint signals and requeue: make a restarted job continue the experiment</title>
    <link href="https://www.wirewalk.com/writing/slurm-checkpoint-signals-requeue-contract/"/>
    <published>2026-06-06T10:00:00-04:00</published>
    <updated>2026-06-06T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/slurm-checkpoint-signals-requeue-contract/</id>
    <summary>Design a restart contract around Slurm signals, durable checkpoints and bounded retries so a requeued training or simulation job resumes useful work rather than repeating it.</summary>
    <content type="html">&lt;p&gt;A requeued job starts its batch script again. It does not resume the instruction that was executing when the node failed. If the application cannot identify a complete checkpoint and restore the experiment from it, a restart may quietly spend another allocation repeating work.&lt;/p&gt;

&lt;p&gt;The scheduler, application and storage system each have a role. Slurm supplies allocation and lifecycle events. The application decides what a consistent checkpoint means. Storage must retain that state beyond the failure you are trying to survive. Design the interface between them before enabling automatic retries.&lt;/p&gt;

&lt;h2 id=&quot;write-down-the-restart-contract&quot;&gt;Write down the restart contract&lt;/h2&gt;

&lt;p&gt;For a simulation, state might include the physical model, iteration, random generator and partitioning assumptions. For training, it can include model weights, optimizer and scheduler state, random generators, data position and configuration. Decide which parts are essential for scientific continuation and which only affect reproducibility within an acceptable tolerance.&lt;/p&gt;

&lt;p&gt;Give the experiment a stable run identifier that survives allocation changes. Keep attempt identifiers separate. A job ID is useful evidence about an execution attempt; it is a poor sole key for the scientific run when a workflow can resubmit work under another ID.&lt;/p&gt;

&lt;p&gt;The startup path should find the newest complete compatible checkpoint, validate its manifest and either restore it or explain why it cannot. Do not silently start a fresh experiment because a file is unreadable. That converts a recovery failure into plausible-looking output from a different run.&lt;/p&gt;

&lt;h2 id=&quot;send-warnings-to-the-process-that-can-act-on-them&quot;&gt;Send warnings to the process that can act on them&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://slurm.schedmd.com/sbatch.html&quot;&gt;sbatch signal reference&lt;/a&gt; distinguishes signals to job steps from signals to the batch shell. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;B:&lt;/code&gt; prefix targets the shell; without it, the warning targets job steps. Choose deliberately according to the launcher and application.&lt;/p&gt;

&lt;p&gt;An illustrative batch header for an application launched as a Slurm step is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --job-name=restart-test&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --time=00:30:00&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --signal=USR1@180&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --requeue&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-euo&lt;/span&gt; pipefail
srun python train.py &lt;span class=&quot;nt&quot;&gt;--run-directory&lt;/span&gt; /shared/experiments/example-run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The path and program are placeholders. This script does not implement checkpointing. Test that the real process receives the signal under the site’s launcher, container and process-management configuration. The warning can arrive earlier than the requested offset because of Slurm event resolution; it is not an exact timer.&lt;/p&gt;

&lt;p&gt;A signal handler should generally request a checkpoint rather than perform complex distributed I/O directly. Let the training loop reach an agreed safe point and coordinate ranks through the application’s supported mechanism. One rank writing while the others advance can produce a set of files that all exist but do not represent the same state.&lt;/p&gt;

&lt;h2 id=&quot;budget-time-for-the-slow-part-of-saving&quot;&gt;Budget time for the slow part of saving&lt;/h2&gt;

&lt;p&gt;Measure checkpoint completion under realistic storage contention, including close, synchronization and publication. An isolated write benchmark does not tell you how long the application needs when many jobs approach their wall-time limits together.&lt;/p&gt;

&lt;p&gt;As a hypothetical sizing exercise, if the slowest accepted checkpoint takes 80 seconds and safe-point coordination takes another 20, a 60-second warning cannot accommodate it. Add operational margin and test the result. Do not treat a percentile from three clean runs as a reliable tail estimate.&lt;/p&gt;

&lt;p&gt;Failure can occur without a warning. Periodic checkpoints should bound lost work when the node disappears abruptly. End-of-time warnings can reduce additional loss, but they do not replace an ongoing recovery policy.&lt;/p&gt;

&lt;h2 id=&quot;publish-only-complete-state&quot;&gt;Publish only complete state&lt;/h2&gt;

&lt;p&gt;Write each checkpoint into a distinct generation. Keep its component list, versions, logical progress and integrity information in a manifest. Publish a completion marker only after the application’s required writes and durability operations finish. The implementation needs filesystem-specific review; rename visibility alone does not prove persistence across every failure mode.&lt;/p&gt;

&lt;p&gt;For a multi-rank run, define whether the manifest represents all ranks or independent recoverable shards. Validate the expected topology and checkpoint format at load time. Restoring on fewer GPUs may require an explicit resharding capability rather than merely changing the resource request.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;/writing/distributed-ai-checkpoint-storage-restart-testing/&quot;&gt;distributed checkpoint storage and restart testing&lt;/a&gt; for the storage side of this contract.&lt;/p&gt;

&lt;h2 id=&quot;separate-retry-eligibility-from-retry-policy&quot;&gt;Separate retry eligibility from retry policy&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--requeue&lt;/code&gt; permits requeue under applicable Slurm conditions; it does not automatically turn every application exit into another attempt. The site’s failure and preemption configuration determines which events cause requeue. Check the deployed scheduler policy and test each intended trigger.&lt;/p&gt;

&lt;p&gt;Choose one owner for requesting retries. If both a workflow engine and an application submit replacement jobs, a single failure can create duplicate experiments. Bound retries and distinguish a transient node failure from a reproducible input, permission or code error.&lt;/p&gt;

&lt;p&gt;Persist retry decisions outside disposable local storage when the policy needs to survive node loss. Include the triggering reason and checkpoint generation in the attempt record. An administrator should be able to stop the loop without deleting the scientific output.&lt;/p&gt;

&lt;h2 id=&quot;prove-continuation-on-another-node&quot;&gt;Prove continuation on another node&lt;/h2&gt;

&lt;p&gt;Start with a small run whose progress and outputs are easy to inspect. Save a checkpoint, stop the attempt through a controlled test, and restore it on another qualified node. Confirm that progress continues from the saved point, configuration matches, and the application does not duplicate completed output.&lt;/p&gt;

&lt;p&gt;Then test an incomplete newest checkpoint, a missing component, an incompatible executable and unavailable storage. Each should produce a specific result rather than a fresh run disguised as recovery. Keep a successful checkpoint while testing failure paths.&lt;/p&gt;

&lt;p&gt;The acceptance question is concrete: after an interrupted allocation, can the next allocation recover the intended experiment, and can someone explain the amount of work lost? A job returning to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RUNNING&lt;/code&gt; answers only the scheduling half.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>RDMA memory registration failures: inspect the job context before changing the fabric</title>
    <link href="https://www.wirewalk.com/writing/rdma-memory-registration-memlock-context/"/>
    <published>2026-06-05T10:00:00-04:00</published>
    <updated>2026-06-05T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/rdma-memory-registration-memlock-context/</id>
    <summary>Trace memory-registration errors through resource limits, userspace providers, containers and process scale instead of treating every verbs failure as a network fault.</summary>
    <content type="html">&lt;p&gt;An MPI job can fail while registering memory before it sends meaningful application traffic. A healthy link light and a clean switch port will not fix a process that lacks the required limit, device access or userspace support.&lt;/p&gt;

&lt;p&gt;Start with the failing process’s context. An interactive root test and an ordinary batch task may inherit different resource limits, groups, libraries and device permissions. If only the privileged test works, that difference is evidence worth following before replacing cables or adjusting subnet settings.&lt;/p&gt;

&lt;h2 id=&quot;preserve-the-first-useful-error&quot;&gt;Preserve the first useful error&lt;/h2&gt;

&lt;p&gt;Capture the original message, return status, allocation size and point in startup where the failure occurs. A later transport fallback or collective hang can hide the initial registration problem. Retain the application and MPI versions, launch command and node list with the logs.&lt;/p&gt;

&lt;p&gt;Keep failure categories distinct. Opening a verbs device, creating a protection domain and registering a memory region are different operations. An error from one does not establish that every later stage would work if its immediate cause were removed.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.kernel.org/6.4/infiniband/user_verbs.html&quot;&gt;Linux userspace-verbs documentation&lt;/a&gt; describes the kernel/userspace boundary and locked-memory accounting. The &lt;a href=&quot;https://github.com/linux-rdma/rdma-core/blob/master/Documentation/libibverbs.md&quot;&gt;rdma-core userspace guidance&lt;/a&gt; explains the associated device access and limits. Those mechanisms predate the current NVIDIA networking stack and remain useful for narrowing the fault domain.&lt;/p&gt;

&lt;h2 id=&quot;read-limits-from-inside-the-actual-allocation&quot;&gt;Read limits from inside the actual allocation&lt;/h2&gt;

&lt;p&gt;In a diagnostic job, collect:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;ulimit&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;ulimit&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/self/limits
&lt;span class=&quot;nb&quot;&gt;id
ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; /dev/infiniband
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The shell reports its inherited context. For a long-running application, inspect the application’s own limits and identity as well, subject to access permissions. A launcher or service can alter the values between the login shell and worker process.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ulimit -l&lt;/code&gt; conventionally displays a shell-specific unit, while &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/proc&lt;/code&gt; labels its values. Record the units instead of pasting numbers into a spreadsheet without them. A low locked-memory limit can explain failures that begin only when message buffers or process counts grow.&lt;/p&gt;

&lt;p&gt;Do not make every user’s locked-memory allowance unlimited as an unexamined fleet-wide workaround. Establish the requirement and the site’s resource policy. Administrators may need to change service, PAM, scheduler or container settings at the point that actually controls inheritance.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-ram-pressure-from-registration-limits&quot;&gt;Distinguish RAM pressure from registration limits&lt;/h2&gt;

&lt;p&gt;Available system memory and permission to lock or register memory are separate constraints. A node can show free RAM while a process reaches a limit relevant to registration. Conversely, raising a limit does not create memory or eliminate a driver resource ceiling.&lt;/p&gt;

&lt;p&gt;Inventory the number of ranks, queue pairs, registered buffers and any registration-cache behavior. The amount of resource demand can scale with peers or communication strategy rather than only the message size shown in a benchmark’s title.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.man7.org/linux/man-pages/man3/ibv_reg_mr.3.html&quot;&gt;ibv_reg_mr manual&lt;/a&gt; defines the memory-region operation and access flags. Use the error reported by the actual provider and kernel to narrow the explanation; do not assign every failure to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;memlock&lt;/code&gt; simply because it is a familiar setting.&lt;/p&gt;

&lt;h2 id=&quot;check-the-userspace-and-kernel-pair&quot;&gt;Check the userspace and kernel pair&lt;/h2&gt;

&lt;p&gt;Record the RDMA driver, firmware, userspace provider and MPI transport components. Distribution packages and a separately installed vendor stack can leave a process loading a different library from the one the administrator inspected.&lt;/p&gt;

&lt;p&gt;Read the resolved library path in the application environment and inspect the supported provider inventory. Keep the node’s package manifest with the test. A container may bring userspace libraries while relying on host device nodes and kernel modules, so successful container startup does not establish transport compatibility.&lt;/p&gt;

&lt;p&gt;Repeat a small registration-capable test through the same scheduler and container launch path as the failing application. Keep the test bounded and use a supported tool from the installed stack. A test that merely lists adapters does not exercise the buffer lifecycle that failed.&lt;/p&gt;

&lt;h2 id=&quot;scale-one-resource-dimension-at-a-time&quot;&gt;Scale one resource dimension at a time&lt;/h2&gt;

&lt;p&gt;Compare a single rank, several ranks on one node, and the smallest multi-node case that reproduces the error. Then vary rank count, buffer size or peers independently where the test permits it. Save both successful and unsuccessful points.&lt;/p&gt;

&lt;p&gt;If registration fails at a consistent per-process buffer size, focus on that process’s limits and allocation path. If failures appear only with many peers, investigate aggregate resource use and connection behavior. If only one node fails, compare its actual software and service context with a known-good peer.&lt;/p&gt;

&lt;p&gt;These are diagnostic directions, not proofs. The next test should distinguish competing explanations. For example, reducing ranks also reduces memory demand and communication complexity, so success at lower scale does not identify which reduction mattered.&lt;/p&gt;

&lt;h2 id=&quot;treat-gpu-memory-registration-as-a-separate-path&quot;&gt;Treat GPU-memory registration as a separate path&lt;/h2&gt;

&lt;p&gt;A successful host-memory verbs test does not prove that GPU memory can use the intended RDMA path. NVIDIA GPU Direct RDMA integration adds dependencies involving the GPU driver, networking stack and supported memory-sharing mechanism.&lt;/p&gt;

&lt;p&gt;Test host and device buffers separately with the supported release combination. Do not install an arbitrary peer-memory module because an online example used it on another kernel. Confirm the vendor support path, loaded modules and workload evidence before changing the image.&lt;/p&gt;

&lt;p&gt;For the wider boundary between host and container, see &lt;a href=&quot;/writing/apptainer-mpi-rdma-host-container-compatibility/&quot;&gt;Apptainer MPI and RDMA compatibility&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;fix-inheritance-then-repeat-the-original-failure&quot;&gt;Fix inheritance, then repeat the original failure&lt;/h2&gt;

&lt;p&gt;Once the cause is supported by evidence, implement the change where it survives ordinary operation. A manual shell adjustment is useful as a test but is not a durable remedy for tasks launched by a service.&lt;/p&gt;

&lt;p&gt;Re-run the original workload at its original scale as an ordinary user. Confirm that the intended transport remains active, registration succeeds, cleanup releases resources and another job can run afterward. That closes the loop between a local diagnostic and a working research service.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Kubernetes security: test admission, network policy, and storage access separately</title>
    <link href="https://www.wirewalk.com/writing/kubernetes-security-boundaries/"/>
    <published>2026-06-02T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/kubernetes-security-boundaries/</id>
    <summary>A namespace is an organizational boundary. Verify the controls that make it an access boundary.</summary>
    <content type="html">&lt;p&gt;A namespace organizes Kubernetes workloads, but isolation depends on the controls around them. Check admission, network policy, identity and storage permissions separately: a workload can be restricted by one and still have excessive access through another.&lt;/p&gt;

&lt;h2 id=&quot;define-the-workloads-permitted-behavior&quot;&gt;Define the workload’s permitted behavior&lt;/h2&gt;

&lt;p&gt;Record whether the application needs privilege, host access, outbound network destinations, secrets, and persistent volumes. Start with actual requirements rather than cloning the permissions of an older deployment.&lt;/p&gt;

&lt;p&gt;Kubernetes documents the Privileged, Baseline, and Restricted &lt;a href=&quot;https://kubernetes.io/docs/concepts/security/pod-security-standards/&quot;&gt;Pod Security Standards&lt;/a&gt;. Choose and enforce an appropriate policy for the target release, with reviewed exceptions for infrastructure components that need additional privileges.&lt;/p&gt;

&lt;h2 id=&quot;inspect-the-deployed-objects&quot;&gt;Inspect the deployed objects&lt;/h2&gt;

&lt;p&gt;Using an authorized read-only Kubernetes context:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kubectl config current-context
kubectl get namespace example-app &lt;span class=&quot;nt&quot;&gt;--show-labels&lt;/span&gt;
kubectl get networkpolicy &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; example-app
kubectl get serviceaccount &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; example-app
kubectl get rolebinding &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; example-app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;example-app&lt;/code&gt; is a placeholder namespace. Confirm the context before every administrative operation. These commands reveal configuration; they do not prove enforcement or effective authorization across all bindings.&lt;/p&gt;

&lt;h2 id=&quot;validate-network-policy-behavior&quot;&gt;Validate network policy behavior&lt;/h2&gt;

&lt;p&gt;The Kubernetes &lt;a href=&quot;https://kubernetes.io/docs/concepts/services-networking/network-policies/&quot;&gt;NetworkPolicy documentation&lt;/a&gt; explains that enforcement depends on a supporting network implementation. The existence of a policy object is insufficient evidence.&lt;/p&gt;

&lt;p&gt;In a lab namespace, run a permitted client and an unrelated client. Test the intended application port, required DNS resolution, and an outbound destination that should be denied. Include both ingress and egress expectations. Keep the tests harmless and restricted to the lab.&lt;/p&gt;

&lt;p&gt;Do not assume policies are an ordered firewall rule list. Review their combination and selection semantics for the deployed implementation. A broad additional allow can change the intended boundary.&lt;/p&gt;

&lt;h2 id=&quot;include-the-storage-path&quot;&gt;Include the storage path&lt;/h2&gt;

&lt;p&gt;A pod with an authorized mount may still receive excessive filesystem permissions or access a shared dataset intended for another workload. For WEKA, PowerScale, VAST, or other CSI-backed storage, examine the storage-side identity and export/share policy as well as the Kubernetes objects.&lt;/p&gt;

&lt;p&gt;Test a synthetic file through the application’s actual container identity. Confirm both required access and denied access outside its scope. An admission policy cannot repair an overly broad storage authorization model by itself.&lt;/p&gt;

&lt;h2 id=&quot;exercise-rejected-workloads&quot;&gt;Exercise rejected workloads&lt;/h2&gt;

&lt;p&gt;Use a disposable manifest that requests a prohibited capability and confirm admission rejects it. Then deploy a compliant workload and run its business transaction. Both results are necessary: a policy that rejects all work is not an acceptable application platform.&lt;/p&gt;

&lt;h2 id=&quot;keep-the-evidence-tied-to-the-release&quot;&gt;Keep the evidence tied to the release&lt;/h2&gt;

&lt;p&gt;Record Kubernetes and network-plugin versions, policy objects, test identities, and expected-versus-observed results. Rerun after cluster upgrades and CNI or CSI changes. The saved manifests show what was intended; the test results show what the cluster enforced.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Reading Slurm accounting without fooling yourself about efficiency</title>
    <link href="https://www.wirewalk.com/writing/slurm-efficiency-accounting-traps/"/>
    <published>2026-05-27T10:00:00-04:00</published>
    <updated>2026-05-27T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/slurm-efficiency-accounting-traps/</id>
    <summary>How to compute CPU and memory efficiency from Slurm&apos;s accounting database so the number survives a sceptical reader, which two field choices produce confidently wrong answers that nobody catches, and why a low fleet figure is almost always a request-shape problem rather than a user-behavior problem.</summary>
    <content type="html">&lt;p&gt;Someone asks how well the cluster is being used. It is a reasonable question and there is a
database full of the answer, so you write a query. Twenty minutes later you have a number, and
the number is wrong in a way that will not announce itself. Both of the common mistakes produce
output that looks like a measurement: one gives you a beautiful figure, one gives you an alarming
figure, and neither has anything to do with how busy the cores were.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct&lt;/code&gt; query needs to distinguish allocated CPU time from consumed CPU time, include the relevant steps and account for how tasks were launched. Once those are right, a low percentage still needs interpretation against the workload.&lt;/p&gt;

&lt;h2 id=&quot;what-cpu-efficiency-actually-is&quot;&gt;What CPU efficiency actually is&lt;/h2&gt;

&lt;p&gt;CPU efficiency is consumed CPU time divided by allocated CPU time:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;efficiency = TotalCPU / (NCPUS * Elapsed)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The denominator is what the scheduler took off the table. If a job holds eight cores for four
hours, nobody else can have those eight cores for those four hours, whether the job uses them or
not. The numerator is what the job’s processes actually burned, user time plus system time, as
measured by the accounting plugin.&lt;/p&gt;

&lt;p&gt;That is exactly what &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt; computes. From the shipped Perl (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;contribs/seff/seff.pl&lt;/code&gt;):&lt;/p&gt;

&lt;div class=&quot;language-perl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$corewalltime&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$walltime&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$ncpus&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$corewalltime&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$cpu_eff&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$cput&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$corewalltime&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So for a single job you can just run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt; and stop reading:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ seff 918442
Job ID: 918442
Cluster: (redacted)
User/Group: user01/user01
State: COMPLETED (exit code 0)
Nodes: 1
Cores per node: 8
CPU Utilized: 04:14:07
CPU Efficiency: 12.55% of 1-09:44:40 core-walltime
Job Wall-clock time: 04:13:05
Memory Utilized: 5.47 GB
Memory Efficiency: 8.55% of 64.00 GB
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt; does not scale. It is one job per invocation and it goes through the Slurm Perl API each
time. For a fleet report over a month of jobs you need &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct&lt;/code&gt;, and that is where the trouble
starts.&lt;/p&gt;

&lt;h2 id=&quot;trap-one-cputimeraw-is-allocation-not-consumption&quot;&gt;Trap one: CPUTimeRAW is allocation, not consumption&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct&lt;/code&gt; offers a field called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt;. The name reads like “the raw CPU time this job used”.
It is not. The manual is unambiguous:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;CPUTimeRAW&lt;/strong&gt; — Time used (Elapsed time * CPU count) by a job or step in cpu-seconds.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the denominator. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTime&lt;/code&gt; is the same quantity in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HH:MM:SS&lt;/code&gt;. It is allocated core-time,
computed arithmetically from the allocation, and it has no idea whether the cores were doing
anything. You can verify this in one line — the identity holds exactly, not approximately:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sacct &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 918442 &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; JobID,NCPUS,ElapsedRaw,CPUTimeRAW &lt;span class=&quot;nt&quot;&gt;--parsable2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--noheader&lt;/span&gt;
918442|8|15185|121480

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;python3 &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;print(8*15185)&quot;&lt;/span&gt;
121480
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The failure mode is that someone builds the ratio out of the field whose name sounded right:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# WRONG — this is the definition of 1.0&lt;/span&gt;
sacct &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; 2026-04-01 &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; 2026-05-01 &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--parsable2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--noheader&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; CPUTimeRAW,NCPUS,ElapsedRaw &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;|&apos;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{u+=$1; a+=$2*$3} END {printf &quot;efficiency %.1f%%\n&quot;, 100*u/a}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;efficiency 100.0%
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It is not 100.0% because the cluster is perfectly used. It is 100.0% because you divided a
quantity by itself. Every job contributes exactly its own allocation to both sides, so the answer
is identically one for any job mix, any time window, any partition. The number is not even
slightly sensitive to reality: drain half the nodes, let jobs idle for days, and it still reads
100.0%.&lt;/p&gt;

&lt;p&gt;The reason this survives review is that 100% is not obviously absurd to a non-specialist. On a
busy cluster with a deep queue, “we are at 100%” reads as a statement about the queue rather than
about the cores. It gets into a slide. The give-away is that it is &lt;em&gt;exactly&lt;/em&gt; 100.0% and stays
exactly 100.0% when you change the window — a real measurement never does that.&lt;/p&gt;

&lt;h2 id=&quot;trap-two-the-allocation-only-flag-zeroes-the-numerator&quot;&gt;Trap two: the allocation-only flag zeroes the numerator&lt;/h2&gt;

&lt;p&gt;The other field you need is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;TotalCPU&lt;/strong&gt; — The sum of the SystemCPU and UserCPU time used by the job or job step.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the right numerator. But CPU time is gathered per &lt;em&gt;step&lt;/em&gt;, not per allocation. A batch job
produces several accounting records: the job allocation record (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;918442&lt;/code&gt;), the batch step
(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;918442.batch&lt;/code&gt;), the external step (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;918442.extern&lt;/code&gt;) that holds anything adopted into the job’s
cgroup, and one record per &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun&lt;/code&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;918442.0&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;918442.1&lt;/code&gt; …). The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-X&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allocations&lt;/code&gt; flag says:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Only show statistics relevant to the job allocation itself, not taking steps into consideration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Which means the step records are not fetched at all, and the step-derived accounting fields are
not populated from them. Everyone knows this about &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt;, because a blank column is visible.
Rather fewer people notice it about &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt;, because it comes back as a plausible-looking time
string rather than a blank:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sacct &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 918442 &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; JobID,NCPUS,ElapsedRaw,TotalCPU
JobID          NCPUS ElapsedRaw   TotalCPU
&lt;span class=&quot;nt&quot;&gt;------------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt;
918442             8      15185   00:00:00
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sacct &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 918442 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; JobID,NCPUS,ElapsedRaw,TotalCPU
JobID          NCPUS ElapsedRaw   TotalCPU
&lt;span class=&quot;nt&quot;&gt;------------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt;
918442             8      15185  04:14:07
918442.batch       8      15185  04:14:07
918442.extern      8      15185   00:00.001
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Same job, same database, two different answers, and the difference is one flag. The job row’s
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;04:14:07&lt;/code&gt; in the second listing is assembled from the step rows that the same query returned;
with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-X&lt;/code&gt; there are no step rows to assemble it from. Build a fleet report on the first form and
every ratio is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0 / something&lt;/code&gt;, so the cluster reads 0.0% efficient.&lt;/p&gt;

&lt;p&gt;That ought to be caught — and usually is, if the whole report is built that way. It is &lt;em&gt;not&lt;/em&gt;
caught when the query includes steps for some jobs and not others, or when someone filters the
zeroes out as “bad records” before averaging. Drop the zero rows and you are left with exactly
the jobs that ran many &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun&lt;/code&gt; steps, which are the well-parallelized ones, and your cluster
suddenly reports 70%.&lt;/p&gt;

&lt;p&gt;Whether the job-level record carries a rolled-up &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; depends on your Slurm version, on
whether the query pulled the steps, and on how the job was launched, so do not take my word for
it. Check on your own installation before you trust any script (this quick check splits on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;:&lt;/code&gt;
only, so run it on a job under a day of CPU time; the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tosec()&lt;/code&gt; function further down handles the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DD-&lt;/code&gt; form):&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sacct &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 918442 &lt;span class=&quot;nt&quot;&gt;--parsable2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--noheader&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; JobID,TotalCPU &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;|&apos;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{ n=split($2,p,&quot;:&quot;); s=(n==3)?p[1]*3600+p[2]*60+p[3]:p[1]*60+p[2];
                 if ($1 ~ /\./) step+=s; else job=s }
               END {printf &quot;job row: %.1fs   sum of steps: %.1fs\n&quot;, job, step}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;job row: 15247.0s   sum of steps: 15247.0s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If those two agree on your cluster, either source is fine. If the job row is zero, you must sum
the steps. Write the script so it works either way and you never have to care.&lt;/p&gt;

&lt;h2 id=&quot;trap-three-the-one-that-produces-a-believable-number&quot;&gt;Trap three: the one that produces a believable number&lt;/h2&gt;

&lt;p&gt;The first two traps produce 100.0% and 0.0%. Those are at least suspicious. The trap that
actually ships is the averaging.&lt;/p&gt;

&lt;p&gt;There are two things you might mean by “cluster efficiency”, and they are not close to each
other:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Job-mean&lt;/strong&gt;: compute efficiency per job, then take the arithmetic mean over jobs.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Core-weighted&lt;/strong&gt;: sum consumed CPU-seconds over the whole fleet, sum allocated CPU-seconds over
the whole fleet, divide once.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Take a constructed month with two populations, chosen to make the arithmetic visible:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;population&lt;/th&gt;
      &lt;th&gt;count&lt;/th&gt;
      &lt;th&gt;cores&lt;/th&gt;
      &lt;th&gt;elapsed&lt;/th&gt;
      &lt;th&gt;per-job eff&lt;/th&gt;
      &lt;th&gt;allocated core-h&lt;/th&gt;
      &lt;th&gt;consumed core-h&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;array tasks&lt;/td&gt;
      &lt;td&gt;12,000&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;5 min&lt;/td&gt;
      &lt;td&gt;95%&lt;/td&gt;
      &lt;td&gt;1,000&lt;/td&gt;
      &lt;td&gt;950&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;wide jobs&lt;/td&gt;
      &lt;td&gt;180&lt;/td&gt;
      &lt;td&gt;128&lt;/td&gt;
      &lt;td&gt;12 h&lt;/td&gt;
      &lt;td&gt;18%&lt;/td&gt;
      &lt;td&gt;276,480&lt;/td&gt;
      &lt;td&gt;49,766&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Job-mean: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(12000 × 0.95 + 180 × 0.18) / 12180 = 93.9%&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Core-weighted: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(950 + 49,766) / (1,000 + 276,480) = 18.3%&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Same data. 93.9% or 18.3%, depending on a choice most people do not realize they are making. The
job-mean is dominated by twelve thousand five-minute array tasks that together account for 0.4%
of the machine. The core-weighted figure is the one that answers “how much of the cluster’s
capacity turned into computation”, which is the question that was asked.&lt;/p&gt;

&lt;p&gt;Use core-weighted for any capacity or spend conversation. Job-mean is useful for exactly one
thing: finding which &lt;em&gt;users&lt;/em&gt; have a habit of over-requesting, where you want each job to count
once regardless of size. Label whichever you publish.&lt;/p&gt;

&lt;h2 id=&quot;the-working-query&quot;&gt;The working query&lt;/h2&gt;

&lt;p&gt;Query without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-X&lt;/code&gt;, take the denominator from the job row and the numerator from the step rows,
and parse the time formats properly. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; is printed as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[DD-[HH:]]MM:SS[.mmm]&lt;/code&gt;, so you will
see &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;00:00.001&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2-03:14:22&lt;/code&gt; in the same column; a naive &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HH:MM:SS&lt;/code&gt; split gets both wrong.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sacct &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; 2026-04-01T00:00:00 &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; 2026-04-30T23:59:59 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;--parsable2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--noheader&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--delimiter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;|&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;--format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;JobID,User,Account,Partition,State,NCPUS,ElapsedRaw,CPUTimeRAW,TotalCPU,ReqMem,MaxRSS,NNodes &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /tmp/acct-apr.psv
&lt;span class=&quot;nb&quot;&gt;wc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; /tmp/acct-apr.psv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;2841577 /tmp/acct-apr.psv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two and a half million rows is a few hundred megabytes of text, so put it somewhere with room —
filling the root filesystem of a login or head node is an unpleasant way to learn that a month of
accounting is bigger than it looks.&lt;/p&gt;

&lt;p&gt;Then aggregate:&lt;/p&gt;

&lt;div class=&quot;language-awk highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/awk -f&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# slurm-eff.awk — core-weighted CPU efficiency by partition&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;BEGIN&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;FS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;|&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;tosec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;   &lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/-/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;-&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;:&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;      &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3600&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;60&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;60&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;             &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;86400&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;                       &lt;span class=&quot;c1&quot;&gt;# step record: the numerator lives here&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;consumed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;tosec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;next&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;                                 &lt;span class=&quot;c1&quot;&gt;# job record: the denominator lives here&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$5&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/^&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;COMPLETED|FAILED|TIMEOUT|OUT_OF_MEMORY|NODE_FAIL&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;next&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$7&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;next&lt;/span&gt;        &lt;span class=&quot;c1&quot;&gt;# sub-2-minute jobs are startup, not work&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;alloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$8&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;            &lt;span class=&quot;c1&quot;&gt;# CPUTimeRAW == NCPUS * ElapsedRaw&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;part&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$4&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;END&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;alloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;part&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;alloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;part&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;consumed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;TA&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;alloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;TC&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;consumed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%-12s %14s %14s %8s\n&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;partition&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;alloc_core_h&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;used_core_h&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;eff&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%-12s %14.1f %14.1f %7.1f%%\n&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3600&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3600&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%-12s %14.1f %14.1f %7.1f%%\n&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;TOTAL&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;TA&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3600&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;TC&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3600&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;TC&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;TA&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; slurm-eff.awk /tmp/acct-apr.psv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Illustrative output — these figures are constructed to show the shape of the result, not a
measurement of any particular machine. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;for (p in A)&lt;/code&gt; iterates in an unspecified order, so the
partition block comes out shuffled; sort it yourself if the order matters, but do not pipe the
whole output through &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sort&lt;/code&gt; or the header and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TOTAL&lt;/code&gt; line get sorted along with the data:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;partition      alloc_core_h    used_core_h      eff
normal             276480.4        50716.3    18.3%
long               188411.2        61533.9    32.7%
gpu                 41203.6         9877.1    24.0%
short                1000.2          950.1    95.0%
TOTAL              507095.4       123077.4    24.3%
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three details in that script are load-bearing.&lt;/p&gt;

&lt;p&gt;The state filter excludes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RUNNING&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PENDING&lt;/code&gt;. A running job has a growing denominator and a
numerator that is only as fresh as the last accounting poll, so it drags the average down for no
reason. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CANCELLED&lt;/code&gt; is excluded too, though that one is a judgment call: a job canceled at 90%
of its walltime really did consume the allocation, and if your users cancel a lot you should
count it. Say which you did.&lt;/p&gt;

&lt;p&gt;The 120-second floor removes the long tail of jobs that failed at startup. On a cluster with heavy
array use these can be the majority of records by count and a rounding error by core-hours, so the
floor barely moves the core-weighted number — but it removes thousands of 0% rows that would wreck
a job-mean.&lt;/p&gt;

&lt;p&gt;The step loop sums &lt;em&gt;all&lt;/em&gt; step records including &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.extern&lt;/code&gt;. That is deliberate, and it is the next
trap.&lt;/p&gt;

&lt;h2 id=&quot;where-the-obvious-reading-is-wrong-extern-and-ssh-launched-ranks&quot;&gt;Where the obvious reading is wrong: extern and SSH-launched ranks&lt;/h2&gt;

&lt;p&gt;The tidy instinct is to drop &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.extern&lt;/code&gt; from the numerator. It is the container step for the job’s
cgroup, it normally shows a millisecond or two of CPU, and it feels like noise.&lt;/p&gt;

&lt;p&gt;On a site running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pam_slurm_adopt&lt;/code&gt;, it is not always noise. The thing to understand is that
“&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mpirun&lt;/code&gt; instead of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun&lt;/code&gt;” is not by itself the problem — the question is whether the launcher
bootstraps through Slurm or through SSH. Open MPI’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mpirun&lt;/code&gt;, inside an allocation, uses &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srun&lt;/code&gt; to
start its daemons, so a step record does exist. Intel MPI exported with
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;I_MPI_HYDRA_BOOTSTRAP=ssh&lt;/code&gt;, Open MPI forced onto the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rsh&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh&lt;/code&gt; launcher or built without Slurm
support, and hand-rolled &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh&lt;/code&gt;-in-a-loop launchers all start the remote processes over SSH, and
none of those produce a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;918442.0&lt;/code&gt; on the remote nodes.&lt;/p&gt;

&lt;p&gt;What there is on those nodes, if adoption is configured, is the external step — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pam_slurm_adopt&lt;/code&gt;
puts the incoming SSH session into the job’s extern cgroup, and the adopted processes’ CPU time is
then accounted against &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.extern&lt;/code&gt; rather than against any launch step.&lt;/p&gt;

&lt;p&gt;Drop &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.extern&lt;/code&gt; and every one of those jobs reports roughly &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1/N&lt;/code&gt; efficiency, where N is the node
count, because you counted only the rank on the batch node. A 16-node job that is running
perfectly reads 6%. That is a very convincing-looking finding. It is also completely false, and it
points the investigation at the users who are doing the most demanding work.&lt;/p&gt;

&lt;p&gt;The check takes one run:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; slurm-eff.awk /tmp/acct-apr.psv | &lt;span class=&quot;nb&quot;&gt;tail&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt;
TOTAL              507095.4       123077.4    24.3%

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;\.extern|&apos;&lt;/span&gt; /tmp/acct-apr.psv | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; slurm-eff.awk | &lt;span class=&quot;nb&quot;&gt;tail&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt;
TOTAL              507095.4        94112.8    18.6%
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A gap that size between the two runs tells you a meaningful fraction of your CPU time is being
recorded against the external step, which tells you that work is arriving on compute nodes by some
route other than a Slurm launch step. That is worth knowing on its own. If the two runs agree to
within a percent, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.extern&lt;/code&gt; genuinely is noise on your cluster and either choice is fine.&lt;/p&gt;

&lt;p&gt;There is a worse version of this. If adoption is &lt;em&gt;not&lt;/em&gt; configured, the remote ranks belong to no
step and no cgroup, and their CPU time is not recorded anywhere at all. No amount of careful
querying recovers it. The symptom is an MPI-heavy partition that reports implausibly low
efficiency while the nodes are visibly hot; confirm by watching &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ps&lt;/code&gt; on a compute node during one
of those jobs, or by comparing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct&lt;/code&gt; against a node-level metric such as a CPU-utilization
exporter. If that is your situation, the accounting database cannot answer the efficiency question
for those jobs and you should say so rather than publish the number.&lt;/p&gt;

&lt;h2 id=&quot;the-memory-half&quot;&gt;The memory half&lt;/h2&gt;

&lt;p&gt;CPU efficiency alone will mislead you about waste. On most general-purpose clusters memory is the
binding constraint more often than cores, and a job that holds a node’s entire RAM while using
6 GB of it is wasting the machine even at 100% CPU.&lt;/p&gt;

&lt;p&gt;The fields:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sacct &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 918442 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; JobID,ReqMem,MaxRSS,MaxRSSNode,MaxRSSTask,TRESUsageInTot%40 &lt;span class=&quot;nt&quot;&gt;--units&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;G
JobID          ReqMem     MaxRSS MaxRSSNode MaxRSSTask                        TRESUsageInTot
&lt;span class=&quot;nt&quot;&gt;------------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-------------------------------------&lt;/span&gt;
918442            64G
918442.batch            5.47G      nodeA             0   &lt;span class=&quot;nv&quot;&gt;cpu&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;04:14:07,energy&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0,fs/disk&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;12.1G,
                                                          &lt;span class=&quot;nv&quot;&gt;mem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;5.47G,pages&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0,vmem&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;6.02G
918442.extern              0       nodeA             0   &lt;span class=&quot;nv&quot;&gt;cpu&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;00:00:00,mem&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0,pages&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0,vmem&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TRESUsageInTot&lt;/code&gt; column is wrapped here to fit the page; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct&lt;/code&gt; truncates it to the width
you asked for instead. Exact unit rendering — trailing zeroes, which fields &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--units&lt;/code&gt; reaches —
moves about between versions, so match your own output rather than this one.)&lt;/p&gt;

&lt;p&gt;Two things to fix in your head.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ReqMem&lt;/code&gt; changed meaning in 21.08.&lt;/strong&gt; The release notes are explicit: it now “shows the requested
memory of the whole job with a letter appended indicating units”, and it is only displayed for the
job record, not the steps. Before that it carried a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Mn&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Mc&lt;/code&gt; suffix meaning per-node or
per-core, and you had to multiply by node count or core count yourself to get the job total. A
script written against the old format and run against a new cluster — or the reverse — is wrong by
a factor equal to the core count, which on a 128-core node is not subtle. Check your version
before you write the parser:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sacct &lt;span class=&quot;nt&quot;&gt;-V&lt;/span&gt;
slurm 24.05.7
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; is a maximum over tasks, not a sum.&lt;/strong&gt; The existence of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSSTask&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSSNode&lt;/code&gt;
tells you this directly: they name &lt;em&gt;which&lt;/em&gt; task and &lt;em&gt;which&lt;/em&gt; node hit the peak. For a single-task
job, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; is the job’s memory. For a 128-rank MPI job where every rank uses 3 GB, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt;
reports 3 GB while the job actually held 384 GB. Divide that by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ReqMem&lt;/code&gt; and you will conclude the
job over-requested by a factor of 128 and go and tell the user so.&lt;/p&gt;

&lt;p&gt;The field to reach for instead is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mem=&lt;/code&gt; inside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TRESUsageInTot&lt;/code&gt;, which the manual defines as
“Tres total usage in by all tasks in job” — the per-task peaks added up. Note what that is and is
not: because the peaks need not have happened at the same moment, the sum is an upper bound on
what the job held simultaneously, not a measurement of it. It is still much closer to the truth
than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; for a multi-task job.&lt;/p&gt;

&lt;p&gt;Do not assume &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt; settles this for you. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt; does not read &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tres_usage_in_tot&lt;/code&gt; at all: it
takes the per-task maximum from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tres_usage_in_max&lt;/code&gt;, keeps the largest one across the steps, and
multiplies by that step’s task count. On a job whose ranks are all doing the same thing that is a
fair estimate; on one where a single rank holds most of the memory it can be far out in either
direction. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt; is honest about this — for a multi-task step it labels the line
“(estimated maximum)”. So &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt;’s “Memory Utilized”, a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; query and a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TRESUsageInTot&lt;/code&gt;
query can produce three different numbers for the same job, and none of them is a true
simultaneous job-wide peak, because Slurm does not record one.&lt;/p&gt;

&lt;p&gt;One more limit worth stating plainly: memory accounting is, historically, sampled.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobAcctGatherFrequency&lt;/code&gt; defaults to 30 seconds for the task datatype, and a job that allocates
200 GB for four seconds and frees it can poll clean and show a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; of 8 GB.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cgroup/v2&lt;/code&gt; plugin improves on that by taking &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; from the kernel’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;memory.peak&lt;/code&gt;, which
is a high-water mark rather than a sample. Two things then follow, and they pull in opposite
directions. First, filesystem-backed memory counts: the page cache a job generates by reading and
writing files is included in the reported RSS unless you set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobAcctGatherParams=no_file_cache&lt;/code&gt;,
so an I/O-heavy job can look memory-hungry when it is not. Second, the manual is explicit that
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;no_file_cache&lt;/code&gt; “disables the use of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;memory.peak&lt;/code&gt; interface, which can result in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt;
failing to record short memory spikes” — the cleaner number costs you the high-water mark. Slurm
24.11 also lists a fix for jobs that run shorter than two gather intervals, which previously could
report nothing at all.&lt;/p&gt;

&lt;p&gt;So there is no single answer to “is my &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; trustworthy”: it depends on your
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobAcctGatherType&lt;/code&gt;, your cgroup version, your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobAcctGatherParams&lt;/code&gt; and your Slurm version. Check
which path your cluster is on before you tell users to cut their memory requests, and leave
headroom either way. A job killed by the OOM handler costs more than the memory it was holding.&lt;/p&gt;

&lt;h2 id=&quot;array-jobs&quot;&gt;Array jobs&lt;/h2&gt;

&lt;p&gt;Arrays need care for three separate reasons.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sacct &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 918500 &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; JobID,JobIDRaw,State,NCPUS,ElapsedRaw
JobID            JobIDRaw      State   NCPUS ElapsedRaw
&lt;span class=&quot;nt&quot;&gt;---------------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-------&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;----------&lt;/span&gt;
918500_[4-500]      918500    PENDING       1          0
918500_1            918501  COMPLETED       1        363
918500_2            918502  COMPLETED       1        358
918500_3            918503  COMPLETED       1        371
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;First, the pending master record &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;918500_[4-500]&lt;/code&gt; is a real row with a real &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobID&lt;/code&gt;. It has zero
elapsed time so it contributes nothing to a core-weighted sum, but it is one row out of many in a
job-mean, and if you are counting jobs it inflates your count by one per array rather than one per
task. Filter on state.&lt;/p&gt;

&lt;p&gt;Second, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobID&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobIDRaw&lt;/code&gt; differ for array tasks. Step records are keyed on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobID&lt;/code&gt; form
(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;918500_2.batch&lt;/code&gt;), so join on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobID&lt;/code&gt;, not &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobIDRaw&lt;/code&gt;. Mixing the two silently drops the
numerator for every array task. The raw ids are handed out as tasks are scheduled, so do not
assume they are contiguous, ordered, or related to the task index in any useful way.&lt;/p&gt;

&lt;p&gt;Third, and most important: arrays are how one user generates a hundred thousand accounting rows.
Any per-job average is now a report on that one user’s array. This is the single biggest reason
to publish the core-weighted figure.&lt;/p&gt;

&lt;h2 id=&quot;the-traps-and-the-answer-each-one-produces&quot;&gt;The traps, and the answer each one produces&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Trap&lt;/th&gt;
      &lt;th&gt;Wrong answer it produces&lt;/th&gt;
      &lt;th&gt;How to spot it&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt; used as consumed CPU&lt;/td&gt;
      &lt;td&gt;Exactly 100.0%, always&lt;/td&gt;
      &lt;td&gt;Figure does not move when you change the window&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-X&lt;/code&gt; with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt;, where the job row is not rolled up&lt;/td&gt;
      &lt;td&gt;Exactly 0.0%&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; column reads &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;00:00:00&lt;/code&gt; for every job&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Zero rows filtered out as “bad data” after using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-X&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;60–80%, entirely fictional&lt;/td&gt;
      &lt;td&gt;Row count after filter is a small fraction of jobs&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Summing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; over job &lt;em&gt;and&lt;/em&gt; step rows&lt;/td&gt;
      &lt;td&gt;Roughly double; some jobs &amp;gt;100%&lt;/td&gt;
      &lt;td&gt;Any per-job efficiency above 100%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Step &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NCPUS&lt;/code&gt; used in the denominator&lt;/td&gt;
      &lt;td&gt;Inflated; varies by launch style&lt;/td&gt;
      &lt;td&gt;Denominator smaller than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt; on the job row&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Mean of per-job ratios&lt;/td&gt;
      &lt;td&gt;90%+ on an array-heavy cluster&lt;/td&gt;
      &lt;td&gt;Job count in the thousands, core-hours dominated by tens of jobs&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.extern&lt;/code&gt; dropped where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pam_slurm_adopt&lt;/code&gt; adopts SSH-launched ranks&lt;/td&gt;
      &lt;td&gt;MPI partitions read at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1/N&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Re-run including &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.extern&lt;/code&gt; and compare&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;No adoption configured, ranks launched over SSH&lt;/td&gt;
      &lt;td&gt;Unrecoverable under-count&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct&lt;/code&gt; disagrees with node-level CPU metrics&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RUNNING&lt;/code&gt; jobs included&lt;/td&gt;
      &lt;td&gt;Understated, drifts by time of day&lt;/td&gt;
      &lt;td&gt;Efficiency changes when you re-run the same window&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Jobs straddling the window counted whole&lt;/td&gt;
      &lt;td&gt;Monthly totals exceed the machine’s capacity&lt;/td&gt;
      &lt;td&gt;Sum of months ≠ the year&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-T&lt;/code&gt; used to fix that&lt;/td&gt;
      &lt;td&gt;Some jobs above 100%&lt;/td&gt;
      &lt;td&gt;Truncates elapsed, does not prorate &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; used as job memory&lt;/td&gt;
      &lt;td&gt;Understated by the task count&lt;/td&gt;
      &lt;td&gt;Multi-node jobs all read ~1% memory efficiency&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt; memory quoted as measured&lt;/td&gt;
      &lt;td&gt;An estimate: per-task max × task count&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt; prints “(estimated maximum)” on multi-task steps&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ReqMem&lt;/code&gt; parsed without checking version&lt;/td&gt;
      &lt;td&gt;Off by core count or node count&lt;/td&gt;
      &lt;td&gt;Memory efficiency above 100% or absurdly below&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;SMT threads counted as cores&lt;/td&gt;
      &lt;td&gt;Hard ceiling at 50%&lt;/td&gt;
      &lt;td&gt;No job in the fleet exceeds 50%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct&lt;/code&gt; efficiency compared to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sreport&lt;/code&gt; “Used”&lt;/td&gt;
      &lt;td&gt;The two never agree&lt;/td&gt;
      &lt;td&gt;They are different quantities — see below&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;On that last row: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sreport&lt;/code&gt;’s usage columns are built from what jobs were &lt;em&gt;charged&lt;/em&gt;, which is
allocation-derived — the same family of quantity as the usage that feeds fairshare, though
fairshare additionally applies &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TRESBillingWeights&lt;/code&gt; and a decay half-life, so the two are not
interchangeable either. What matters here is that none of it is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt;. So &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sreport&lt;/code&gt; and
a correct &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct&lt;/code&gt; efficiency query are not meant to agree, and the ratio between them is roughly
your efficiency figure. You can confirm the relationship on your own cluster by checking that
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sreport&lt;/code&gt; totals track your summed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt; rather than your summed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; — if they do,
the model above is right for your version.&lt;/p&gt;

&lt;h2 id=&quot;field-reference&quot;&gt;Field reference&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Field&lt;/th&gt;
      &lt;th&gt;What it is&lt;/th&gt;
      &lt;th&gt;Which record carries it&lt;/th&gt;
      &lt;th&gt;Gotcha&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NCPUS&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AllocCPUS&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Allocated CPU count&lt;/td&gt;
      &lt;td&gt;Job and step&lt;/td&gt;
      &lt;td&gt;Step value can be smaller than the job’s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ElapsedRaw&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Wall seconds&lt;/td&gt;
      &lt;td&gt;Job and step&lt;/td&gt;
      &lt;td&gt;Step elapsed ≠ job elapsed&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NCPUS × ElapsedRaw&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Job and step&lt;/td&gt;
      &lt;td&gt;Allocation, never consumption&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UserCPU + SystemCPU&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Step; job row varies by version&lt;/td&gt;
      &lt;td&gt;Format is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[DD-[HH:]]MM:SS[.mmm]&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UserCPU&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SystemCPU&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;The two halves&lt;/td&gt;
      &lt;td&gt;Step&lt;/td&gt;
      &lt;td&gt;High system time can mask an idle job&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ReqMem&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Requested memory&lt;/td&gt;
      &lt;td&gt;Job only, since 21.08&lt;/td&gt;
      &lt;td&gt;Per-node/per-core suffix before 21.08&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Peak RSS of the largest single task&lt;/td&gt;
      &lt;td&gt;Step&lt;/td&gt;
      &lt;td&gt;Not a sum across tasks&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSSTask&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSSNode&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Which task and node peaked&lt;/td&gt;
      &lt;td&gt;Step&lt;/td&gt;
      &lt;td&gt;Their existence proves &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; is a max&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TRESUsageInTot&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Per-TRES totals, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mem=&lt;/code&gt; summed over tasks&lt;/td&gt;
      &lt;td&gt;Step&lt;/td&gt;
      &lt;td&gt;Sum of per-task peaks: an upper bound, not a simultaneous peak&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TRESUsageInMax&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Per-TRES per-task maxima&lt;/td&gt;
      &lt;td&gt;Step&lt;/td&gt;
      &lt;td&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; number, in TRES form; what &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seff&lt;/code&gt; reads&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AllocTRES&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Full allocation including GRES&lt;/td&gt;
      &lt;td&gt;Job&lt;/td&gt;
      &lt;td&gt;Where GPU counts live&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;State&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Final state&lt;/td&gt;
      &lt;td&gt;Job and step&lt;/td&gt;
      &lt;td&gt;Filter before aggregating&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NNodes&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NTasks&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Shape of the job&lt;/td&gt;
      &lt;td&gt;Job / step&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NTasks&lt;/code&gt; blank on the job record&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobID&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobIDRaw&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Array-form and underlying id&lt;/td&gt;
      &lt;td&gt;Both&lt;/td&gt;
      &lt;td&gt;Join on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JobID&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;worked-example&quot;&gt;Worked example&lt;/h2&gt;

&lt;p&gt;Back to job 918442. Eight cores, 15,185 seconds elapsed, so 121,480 allocated core-seconds. The
steps sum to 15,247 seconds of CPU.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;efficiency = 15247 / 121480 = 12.55%
cores used = 15247 / 15185 = 1.004
allocated  = 8
memory     = 5.47 GiB of 64 GiB requested = 8.55%
waste      = (121480 - 15247) / 3600 = 29.5 core-hours parked
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The percentage is the least useful line there. “1.004 cores out of 8” tells you what happened:
this is a single-threaded program that asked for eight cores. It is not a program that is 12.55%
efficient at using eight cores — it is a program that is 100% efficient at using one core and was
given eight. Nothing the user can do to their code will move the 12.55%. Changing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--cpus-per-task&lt;/code&gt;
from 8 to 1 moves it to roughly 100%, instantly, and on this job — one thread, 5.47 GiB of a
64 GiB request — with no change to runtime. Check the memory before you send that advice, though:
where the site sets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DefMemPerCPU&lt;/code&gt;, cutting the core count cuts the job’s memory with it, and the
user who was quietly using cores as a memory allocation will get an OOM kill for following your
guidance. That is the second of the three rational reasons below, and it is a site configuration
problem, not a user problem.&lt;/p&gt;

&lt;p&gt;That reframing is the whole point. Report &lt;strong&gt;average cores used against cores allocated&lt;/strong&gt;, not a
percentage, and the diagnosis falls out of the number:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Cores used vs allocated&lt;/th&gt;
      &lt;th&gt;Reading&lt;/th&gt;
      &lt;th&gt;What to do&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;~1.0 of N, N &amp;gt; 1&lt;/td&gt;
      &lt;td&gt;Single-threaded job over-requesting&lt;/td&gt;
      &lt;td&gt;Fix the submission script&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;~N of N&lt;/td&gt;
      &lt;td&gt;Working as intended&lt;/td&gt;
      &lt;td&gt;Nothing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;~0.5N of N&lt;/td&gt;
      &lt;td&gt;One thread per SMT core, or half the ranks idle&lt;/td&gt;
      &lt;td&gt;Check &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ThreadsPerCore&lt;/code&gt; before blaming the user&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;≪1.0 of N&lt;/td&gt;
      &lt;td&gt;I/O-bound, or waiting on a license or a lock&lt;/td&gt;
      &lt;td&gt;Look at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SystemCPU&lt;/code&gt; and at the filesystem&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&amp;gt; N&lt;/td&gt;
      &lt;td&gt;Oversubscribed, or no cgroup pinning&lt;/td&gt;
      &lt;td&gt;Check &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TaskPlugin&lt;/code&gt; and the thread-library env&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;~N early, ~1 late&lt;/td&gt;
      &lt;td&gt;Serial post-processing tail&lt;/td&gt;
      &lt;td&gt;Split the job; the average hides it&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The SMT row is worth dwelling on. Depending on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SelectTypeParameters&lt;/code&gt; and the node’s
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ThreadsPerCore&lt;/code&gt;, allocating one core can charge you two CPUs, in which case a perfectly
saturating single-threaded task caps out at 50% and no job on the machine will ever read higher.
Before concluding your users waste half the cluster, check:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;scontrol show node nodeA | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;CPUAlloc|CPUTot|ThreadsPerCore|Boards&apos;&lt;/span&gt;
   &lt;span class=&quot;nv&quot;&gt;CPUAlloc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;128 &lt;span class=&quot;nv&quot;&gt;CPUEfctv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;128 &lt;span class=&quot;nv&quot;&gt;CPUTot&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;128
   &lt;span class=&quot;nv&quot;&gt;Boards&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 &lt;span class=&quot;nv&quot;&gt;SocketsPerBoard&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;2 &lt;span class=&quot;nv&quot;&gt;CoresPerSocket&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;64 &lt;span class=&quot;nv&quot;&gt;ThreadsPerCore&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ThreadsPerCore=1&lt;/code&gt; there, so it is not the explanation on that node. If it reads 2, every
efficiency figure you have is measured against threads.&lt;/p&gt;

&lt;h2 id=&quot;what-a-realistic-fleet-number-looks-like&quot;&gt;What a realistic fleet number looks like&lt;/h2&gt;

&lt;p&gt;I am not aware of a systematic published survey of core-weighted CPU efficiency across academic
clusters, so treat any single quoted figure — including mine — as a prior rather than a
benchmark. The working range I would expect on a general-purpose, mixed-workload cluster is
roughly 35% to 65%. A number in the high thirties on a machine that serves a lot of bioinformatics
and statistics is unremarkable. Below about 25% something structural is usually going on: a
partition configured exclusive so every job charges a whole node, a default &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--cpus-per-task&lt;/code&gt;
that does not match the default thread count of the dominant application, or GPU jobs whose CPU
allocation is incidental.&lt;/p&gt;

&lt;p&gt;Two caveats on the number itself.&lt;/p&gt;

&lt;p&gt;GPU partitions should not be assessed on CPU efficiency at all. A job holding four GPUs and eight
cores to feed them is doing exactly the right thing and will read 10%. You need GPU utilization
from a device-level exporter; the accounting database records that GPUs were allocated, not that
they were busy.&lt;/p&gt;

&lt;p&gt;And the honest reading of a low figure is almost never “users are wasteful”. Sort the parked
core-hours by cause and, on the mixed-workload clusters I have looked at, most of them come from
single-threaded jobs asking for several cores. Users do this for three rational
reasons: they were told to by a tutorial written for a different scheduler, they are using cores
as a proxy for memory because the site’s memory-per-core default is low, or the application is
genuinely threaded but only for one phase of its run. The first is a documentation fix, the second
is a scheduler configuration fix, and only the third is really the user’s problem.&lt;/p&gt;

&lt;p&gt;So publish two columns, not one. Core-hours parked, and the count of jobs where cores-used is
below 1.5 while cores-allocated is above 2. The first is the size of the prize. The second is the
list of submission scripts to go and fix, and it is usually short — a handful of templates that
have been copied across a department.&lt;/p&gt;

&lt;p&gt;This one needs the same &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tosec()&lt;/code&gt; as before. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;awk&lt;/code&gt; accepts &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-f&lt;/code&gt; more than once, so keep that
function in a file of its own and prepend it rather than pasting it twice — an inline program that
calls &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tosec()&lt;/code&gt; without it is a fatal “calling undefined function”, not a silent zero.&lt;/p&gt;

&lt;div class=&quot;language-awk highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# parked.awk — worst over-requesting jobs by parked core-hours&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;BEGIN&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;FS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;|&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;tosec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;next&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$5&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;COMPLETED&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$7&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;600&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;END&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%-12s %-10s %3d cores  %.2f used  %8.1f core-h parked\n&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                   &lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3600&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; tosec.awk &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; parked.awk /tmp/acct-apr.psv | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-k7&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-gr&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Run that, and instead of a percentage you have twenty lines, each naming a submission script and
the number of core-hours it costs per month. That is a conversation you can actually have.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Debugging Intel-compiled C++ and Fortran without losing the optimized failure</title>
    <link href="https://www.wirewalk.com/writing/intel-oneapi-compiler-gdb-optimized-debugging/"/>
    <published>2026-05-14T10:00:00-04:00</published>
    <updated>2026-05-14T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/intel-oneapi-compiler-gdb-optimized-debugging/</id>
    <summary>Build a reproducible Intel compiler investigation with matching symbols, explicit optimization levels, Intel Distribution for GDB and controlled thread and runtime settings.</summary>
    <content type="html">&lt;p&gt;A numerical application that works at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-O0&lt;/code&gt; and fails at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-O2&lt;/code&gt; has supplied an important clue, but not a diagnosis. Optimization can expose undefined behavior, change floating-point evaluation, move instructions or remove variables that a debugger would otherwise display.&lt;/p&gt;

&lt;p&gt;Keep the optimized failure reproducible while building a second executable that is easier to inspect. The investigation should connect the two rather than gradually changing flags until the problem disappears and calling that combination a fix.&lt;/p&gt;

&lt;p&gt;This article uses Linux, the Intel oneAPI C++ and Fortran compilers, and Intel Distribution for GDB. Older Intel compiler and debugger product names should not be treated as interchangeable with the installed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;icpx&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ifx&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gdb-oneapi&lt;/code&gt; tools.&lt;/p&gt;

&lt;h2 id=&quot;preserve-the-executable-libraries-and-input-together&quot;&gt;Preserve the executable, libraries and input together&lt;/h2&gt;

&lt;p&gt;Record compiler and linker versions, full build flags, source revision and input. Retain the module environment and resolved runtime libraries. An MPI wrapper can add flags and libraries that are absent from a command copied out of a build log.&lt;/p&gt;

&lt;p&gt;Keep the failing executable and its debug information. A rebuilt file with the same name is not necessarily the same binary. If a core file is available, preserve the matching executable and shared libraries or a reproducible image that contains them.&lt;/p&gt;

&lt;p&gt;Separate a crash, a hang and a numerical mismatch. They need different evidence. For a mismatch, define the accepted numerical tolerance and preserve reference outputs; a program that simply reaches normal exit has not passed that test.&lt;/p&gt;

&lt;h2 id=&quot;make-optimization-an-explicit-variable&quot;&gt;Make optimization an explicit variable&lt;/h2&gt;

&lt;p&gt;An illustrative CPU build pair is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;icpx &lt;span class=&quot;nt&quot;&gt;-O0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; solver-cpp-debug solver.cpp
icpx &lt;span class=&quot;nt&quot;&gt;-O2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; solver-cpp-opt solver.cpp
ifx &lt;span class=&quot;nt&quot;&gt;-O0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; solver-fortran-debug solver.f90
ifx &lt;span class=&quot;nt&quot;&gt;-O2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; solver-fortran-opt solver.f90
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These commands omit the application’s required build and link options. Preserve MPI, OpenMP, include paths and library choices in the real build. Use separate output paths so a later command cannot silently replace the executable associated with the evidence.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.intel.com/content/www/us/en/developer/articles/technical/compiler-optimization-debugging-trade-off.html&quot;&gt;Intel’s discussion of optimization and debugging&lt;/a&gt; explains the trade-off between transformed code and source-level visibility. Specify both &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-g&lt;/code&gt; and the intended optimization level; do not assume that asking for debug information preserves every other compiler default.&lt;/p&gt;

&lt;p&gt;For a large project, consider narrowing diagnostic changes to a translation unit after confirming that the failure survives. Changing the entire executable at once may alter timing and memory layout so much that the useful symptom vanishes.&lt;/p&gt;

&lt;h2 id=&quot;establish-an-ordinary-host-debugging-session-first&quot;&gt;Establish an ordinary host-debugging session first&lt;/h2&gt;

&lt;p&gt;Use the installed tool environment and launch the small reproducer:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gdb-oneapi ./solver-cpp-debug
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For a native host program, familiar GDB operations provide a useful starting point:&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(gdb) set pagination off
(gdb) break main
(gdb) run
(gdb) info threads
(gdb) thread apply all bt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Choose a real source or procedure breakpoint for the Fortran program rather than assuming the C++ example’s entry point is appropriate. Inspect the thread and frame that owns the state of interest before printing variables.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.intel.com/content/www/us/en/developer/articles/release-notes/gdb/2025.html&quot;&gt;Intel Distribution for GDB 2025 release notes&lt;/a&gt; describe capabilities and platform requirements. Native CPU debugging and debugging an offloaded kernel are different target paths. A successful host breakpoint does not establish device-debug support for an arbitrary accelerator backend.&lt;/p&gt;

&lt;h2 id=&quot;interpret-optimized-state-as-generated-code&quot;&gt;Interpret optimized state as generated code&lt;/h2&gt;

&lt;p&gt;A variable marked optimized out is not proof of memory corruption. Its value may no longer have an independently addressable location at that point. Source lines can execute out of apparent order, and inlining can change the visible call stack.&lt;/p&gt;

&lt;p&gt;Use the optimized executable’s symbols, assembly view and surrounding instruction sequence when source stepping becomes ambiguous. Compare the inputs to the relevant operation instead of insisting that every source variable remain inspectable. The &lt;a href=&quot;https://sourceware.org/gdb/current/onlinedocs/gdb.html/Optimized-Code.html&quot;&gt;GDB optimized-code guidance&lt;/a&gt; explains this distinction.&lt;/p&gt;

&lt;p&gt;If a numerical difference appears, examine the language and floating-point contract as well as code generation. Preserve compiler diagnostics and the relevant optimization report when available. Reducing an optimization level is a useful experiment; it does not by itself establish a compiler defect.&lt;/p&gt;

&lt;h2 id=&quot;keep-thread-placement-and-runtime-state-reproducible&quot;&gt;Keep thread placement and runtime state reproducible&lt;/h2&gt;

&lt;p&gt;For OpenMP applications, record thread count, affinity policy and the runtime library loaded by the process. The same executable can behave differently when a batch system grants a different CPU set or another module adds a different runtime to the library path.&lt;/p&gt;

&lt;p&gt;Inspect all thread stacks for a hang. Distinguish a thread doing useful computation, one waiting at a barrier and one blocked on I/O or a lock. A snapshot shows where each thread stopped, not necessarily which thread caused the delay. Take a second bounded observation if needed to determine whether progress continues.&lt;/p&gt;

&lt;p&gt;When MPI is involved, reduce the run to the smallest reproducing rank configuration. Stopping one rank at a breakpoint can make the others wait normally in a collective; do not misreport that debugger-induced wait as the original deadlock. Use the site’s supported multi-process debugging workflow for the full case.&lt;/p&gt;

&lt;h2 id=&quot;use-diagnostics-that-match-the-language&quot;&gt;Use diagnostics that match the language&lt;/h2&gt;

&lt;p&gt;Fortran bounds and runtime-check facilities can help narrow indexing and argument errors, but their flags and coverage depend on compiler release and program features. Enable the documented checks deliberately and retain the exact build configuration.&lt;/p&gt;

&lt;p&gt;For C++, investigate lifetime, bounds, aliasing and data-race assumptions with tools supported by that compiler/runtime combination. Do not assume a diagnostic build proves that an uninstrumented concurrent program is free of races. Keep an input-level regression test alongside any tool-specific result.&lt;/p&gt;

&lt;p&gt;Avoid editing variable values in the debugger as evidence of a production fix. It can be useful for testing a hypothesis, but the final remedy must be expressed in source, build configuration or an identified runtime requirement that ordinary users receive.&lt;/p&gt;

&lt;h2 id=&quot;escalate-with-a-reduced-case-and-a-comparison-matrix&quot;&gt;Escalate with a reduced case and a comparison matrix&lt;/h2&gt;

&lt;p&gt;A useful compiler issue report includes source, exact flags, versions, target CPU assumptions and expected versus observed behavior. Show the smallest set of changes that switches the result, with the original input and correctness check retained.&lt;/p&gt;

&lt;p&gt;Include successful and failing configurations without asserting that every difference is causal. If changing compiler, optimization, thread count and host simultaneously makes the issue disappear, the next task is separating those variables.&lt;/p&gt;

&lt;p&gt;Validate the remedy under the original optimized configuration and normal allocation path. Then use &lt;a href=&quot;/writing/intel-vtune-pcm-core-cache-memory-analysis/&quot;&gt;Intel core, cache and memory analysis&lt;/a&gt; to examine performance. Debugging establishes a trustworthy computation; profiling determines which parts of that computation consume the available machine.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>RoCE congestion: follow ECN, CNP and pause traffic through one controlled test</title>
    <link href="https://www.wirewalk.com/writing/roce-congestion-ecn-pfc-investigation/"/>
    <published>2026-05-11T10:00:00-04:00</published>
    <updated>2026-05-11T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/roce-congestion-ecn-pfc-investigation/</id>
    <summary>Investigate RoCE congestion with matched workload intervals, queue mappings and counter deltas before changing thresholds or blaming packet loss.</summary>
    <content type="html">&lt;p&gt;A RoCE fabric can pass a clean point-to-point bandwidth test and struggle when many nodes send to one destination. That result is not contradictory. The second workload creates a queueing problem that the first test may never exercise.&lt;/p&gt;

&lt;p&gt;To investigate, choose a reproducible traffic pattern and follow its classification and congestion signals from the sender to the receiver. Changing several buffer and threshold settings at once can make a benchmark faster while leaving the cause unknown and another workload worse.&lt;/p&gt;

&lt;p&gt;This is a diagnostic workflow for an already designed, supported RoCE deployment. Queue names, counters and control settings depend on the adapter, switch ASIC and software release. It does not supply universal threshold values.&lt;/p&gt;

&lt;h2 id=&quot;draw-the-traffics-actual-path&quot;&gt;Draw the traffic’s actual path&lt;/h2&gt;

&lt;p&gt;Record the endpoints, adapters, switch ports, link rates and relevant routing paths. Include the return path used by congestion notifications. For a multi-path fabric, identify whether runs use comparable paths or whether a routing change is part of the experiment.&lt;/p&gt;

&lt;p&gt;Write down how packets are marked and classified at every boundary. A sender’s traffic class, an on-wire marking and a switch queue are related by configuration; they are not interchangeable names. Confirm the trust policy and mappings rather than inferring them from a VLAN or interface description.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-50/Layer-1-and-Switch-Ports/Quality-of-Service/RDMA-over-Converged-Ethernet-RoCE/&quot;&gt;NVIDIA’s Cumulus Linux 5.0 RoCE documentation&lt;/a&gt; is a release-specific example of the relationship between congestion notification and priority flow control. Apply the model through the manuals for the installed platform, not copied commands from another switch family.&lt;/p&gt;

&lt;h2 id=&quot;separate-the-mechanisms-you-are-observing&quot;&gt;Separate the mechanisms you are observing&lt;/h2&gt;

&lt;p&gt;ECN marking provides congestion information. In a RoCE congestion-control path, receiver-generated CNP traffic helps notify the sender. PFC pauses a priority on a link when its configured condition is reached. The mechanisms act at different points and have different consequences for neighboring traffic.&lt;/p&gt;

&lt;p&gt;The useful diagnostic question is how the system responds as offered load rises. Do marked packets and notifications appear? Does the sender’s behavior change? Does a queue remain persistently pressured? Are pause intervals short and localized, or does their impact spread?&lt;/p&gt;

&lt;p&gt;A pause-frame count alone cannot answer those questions. Interpret the vendor counter: frames, duration, transitions and per-priority accounting tell different stories. Record counter resets and support limitations. Missing telemetry on one hop is a gap in the evidence, not proof that the hop was quiet.&lt;/p&gt;

&lt;h2 id=&quot;capture-deltas-over-the-same-interval&quot;&gt;Capture deltas over the same interval&lt;/h2&gt;

&lt;p&gt;Take before and after snapshots on relevant endpoints and switch ports using the platform’s supported read-only commands. Align the timestamps with application logs. Retain raw snapshots so a later reader can recalculate differences and inspect other fields.&lt;/p&gt;

&lt;p&gt;Measure transmitted data, ECN marks, CNP activity, pause behavior, drops, link errors and application throughput where those measurements are available. Separate physical errors from congestion-driven loss. A cable fault and a queue-policy problem can both reduce useful throughput but need different remedies.&lt;/p&gt;

&lt;p&gt;Do not clear production counters just to make arithmetic easier. Clearing can erase another team’s incident evidence. Counter deltas over a named interval are usually enough, provided that restarts or wraps are identified.&lt;/p&gt;

&lt;h2 id=&quot;move-from-a-quiet-baseline-to-a-controlled-incast&quot;&gt;Move from a quiet baseline to a controlled incast&lt;/h2&gt;

&lt;p&gt;Begin with one pair to establish connectivity and the expected data path. Then introduce a bounded many-to-one pattern that resembles the production workload. Increase senders in steps while holding message size, placement and duration constant.&lt;/p&gt;

&lt;p&gt;Record useful application work and latency distribution, not only total bytes moved. In distributed training, one delayed rank can affect the whole step even when average link utilization looks acceptable. Correlate communication phases with the network interval rather than comparing unrelated dashboard peaks.&lt;/p&gt;

&lt;p&gt;Run a comparable unrelated flow where the design permits it. If a congested priority or shared resource harms that flow, the fabric’s operating behavior includes that effect. A synthetic test should not be allowed to disrupt production users; schedule the experiment on an agreed subset with a stop condition.&lt;/p&gt;

&lt;h2 id=&quot;interpret-combinations-rather-than-single-counters&quot;&gt;Interpret combinations rather than single counters&lt;/h2&gt;

&lt;p&gt;Consider a hypothetical run where throughput flattens as sender count doubles, queue pressure rises and pause duration grows across several upstream ports. That pattern supports investigating congestion propagation. It does not prove which threshold should change or establish that the receiver is healthy.&lt;/p&gt;

&lt;p&gt;Check the receiver’s ability to consume the workload. PCIe placement, CPU progress, GPU synchronization and application behavior can create a destination bottleneck that no switch adjustment removes. Read the adapter’s supported congestion-control configuration as well as the switch policy.&lt;/p&gt;

&lt;p&gt;If drops rise without the expected congestion notifications, inspect marking, queue mapping and control-path handling. If notifications rise but throughput oscillates, investigate the complete feedback path and its configuration. Keep these as hypotheses until a targeted experiment distinguishes them.&lt;/p&gt;

&lt;h2 id=&quot;change-one-supported-control-and-preserve-rollback&quot;&gt;Change one supported control and preserve rollback&lt;/h2&gt;

&lt;p&gt;Save the current configuration and the exact test. Choose one change justified by the observed failure mode, review its effect on shared resources, and use the vendor’s supported range and procedure. Buffer allocation changes can affect traffic beyond the test’s priority.&lt;/p&gt;

&lt;p&gt;Repeat the baseline and stressed cases, including the neighboring workload. A successful change improves the intended behavior without creating a new failure at lower load or on another traffic class. Restore the previous state if evidence is inconclusive.&lt;/p&gt;

&lt;p&gt;Keep the test report small enough to use during an incident: path diagram, mapping table, software versions, offered load, interval deltas and application outcome. For the broader architectural comparison, see &lt;a href=&quot;/writing/mpi-infiniband-vs-spectrumx/&quot;&gt;InfiniBand and Spectrum-X for MPI&lt;/a&gt;. The architecture explains available mechanisms; this experiment establishes what one deployed fabric actually did.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>OpenSCAP reports: preserve the exceptions behind the score</title>
    <link href="https://www.wirewalk.com/writing/openscap-hardening-evidence/"/>
    <published>2026-05-09T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/openscap-hardening-evidence/</id>
    <summary>A scan result becomes useful evidence when the profile, content version, scope, and exceptions are retained.</summary>
    <content type="html">&lt;p&gt;A higher OpenSCAP score may mean a host was hardened. It may also mean rules were excluded or a different profile was selected. Keep the scan inputs beside the result so a reviewer can tell which happened.&lt;/p&gt;

&lt;h2 id=&quot;pin-the-benchmark-inputs&quot;&gt;Pin the benchmark inputs&lt;/h2&gt;

&lt;p&gt;Record the operating-system release, OpenSCAP version, content package version, selected profile, tailoring file, and target identity. Retain the original machine-readable result along with any HTML report.&lt;/p&gt;

&lt;p&gt;OpenSCAP documents configuration evaluation with XCCDF and OVAL and the use of profiles in its &lt;a href=&quot;https://www.open-scap.org/tools/openscap-base/&quot;&gt;tool overview&lt;/a&gt;. A tool’s ability to evaluate a benchmark does not certify the organization or establish that the benchmark fits the workload.&lt;/p&gt;

&lt;h2 id=&quot;inspect-before-evaluating&quot;&gt;Inspect before evaluating&lt;/h2&gt;

&lt;p&gt;On a lab host with OpenSCAP and the relevant content installed:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;oscap &lt;span class=&quot;nt&quot;&gt;-V&lt;/span&gt;
oscap info /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The content path is an example for an installed RHEL 9 SCAP Security Guide package. Use the actual available data stream and read its listed profiles. Do not paste a profile identifier from a different release and assume it selected the intended controls.&lt;/p&gt;

&lt;p&gt;Run a non-remediating evaluation first. Preserve both the process status and the report’s semantic results. Evaluation errors, not-applicable rules, and failed rules mean different things.&lt;/p&gt;

&lt;h2 id=&quot;review-exceptions-individually&quot;&gt;Review exceptions individually&lt;/h2&gt;

&lt;p&gt;For each excluded or accepted finding, record the rule, affected systems, operational reason, compensating control, owner, and review date. Avoid a blanket exception such as “HPC nodes need performance.” A specific setting may be necessary for one workload and unnecessary elsewhere.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Finding state&lt;/th&gt;
      &lt;th&gt;Required follow-up&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Failed and applicable&lt;/td&gt;
      &lt;td&gt;Remediate or approve a bounded exception&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Not applicable&lt;/td&gt;
      &lt;td&gt;Verify why it does not apply&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Evaluation error&lt;/td&gt;
      &lt;td&gt;Repair the assessment path&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Excluded by tailoring&lt;/td&gt;
      &lt;td&gt;Review the tailoring decision&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A score without these states hides the information an auditor or operator needs most.&lt;/p&gt;

&lt;h2 id=&quot;test-remediation-as-a-service-change&quot;&gt;Test remediation as a service change&lt;/h2&gt;

&lt;p&gt;Do not enable automatic remediation across an estate as the first experiment. Review proposed changes, apply a small subset to a pilot, and test application behavior and recovery access.&lt;/p&gt;

&lt;p&gt;Some controls affect authentication, mounts, kernel behavior, or cryptography. Their operational consequences may not appear until a reboot or a new session. Include those lifecycle events in the pilot acceptance test.&lt;/p&gt;

&lt;h2 id=&quot;compare-like-with-like&quot;&gt;Compare like with like&lt;/h2&gt;

&lt;p&gt;When a later scan differs, compare content and profile versions before attributing the change to configuration drift. A revised benchmark can produce a different result on an unchanged host.&lt;/p&gt;

&lt;p&gt;Keep a small evidence bundle for each assessment: input hashes, target inventory, results, exceptions, remediation record, and post-change checks. Use that bundle to review the specific hosts and controls assessed. It cannot establish compliance for systems and requirements outside the scan.&lt;/p&gt;

&lt;p&gt;Related: &lt;a href=&quot;/writing/selinux-denials-without-disabling/&quot;&gt;SELinux diagnosis&lt;/a&gt; and &lt;a href=&quot;/writing/ansible-linux-patching-canaries/&quot;&gt;staged Linux maintenance&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>GPUDirect Storage: prove the data path before claiming a faster training pipeline</title>
    <link href="https://www.wirewalk.com/writing/gpudirect-storage-direct-path-validation/"/>
    <published>2026-05-02T10:00:00-04:00</published>
    <updated>2026-05-02T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/gpudirect-storage-direct-path-validation/</id>
    <summary>Evaluate cuFile and GPUDirect Storage with direct-path evidence, fallback detection and application-level measurements, including cases where the data loader remains the bottleneck.</summary>
    <content type="html">&lt;p&gt;Installing GPUDirect Storage does not make an ordinary file read into a GPU-direct transfer. The application, filesystem and platform must participate in a supported path, and a successful cuFile operation may still use a compatibility path.&lt;/p&gt;

&lt;p&gt;Begin with a narrow question: for this file, GPU, software stack and workload, which path moved the data? Only after answering that should you decide whether the change improved the research application enough to justify operating it.&lt;/p&gt;

&lt;p&gt;The discussion uses established cuFile and GDS concepts, including compatibility mode, without assuming that every filesystem or GPU has the same support. Match the installed release to its archived support documentation; current release notes may describe paths unavailable in an older deployment.&lt;/p&gt;

&lt;h2 id=&quot;draw-the-read-path-the-application-needs&quot;&gt;Draw the read path the application needs&lt;/h2&gt;

&lt;p&gt;List where bytes start, what transforms them, and when they reach device memory. A training pipeline may read compressed objects, decode samples on CPUs, assemble batches and then transfer tensors. Avoiding one host staging step may not help if decompression or sample discovery dominates.&lt;/p&gt;

&lt;p&gt;Identify the I/O interface actually used by the application. A framework’s ordinary Python data loader should not be assumed to call cuFile. If an adapter or specialized library provides GDS integration, record its version, configuration and fallback behavior.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.nvidia.com/gpudirect-storage/design-guide/index.html&quot;&gt;NVIDIA’s GDS design guide&lt;/a&gt; explains the architectural objective. Treat that objective as a path to validate, not an automatic property of storage connected to a server with an NVIDIA GPU.&lt;/p&gt;

&lt;h2 id=&quot;qualify-the-software-and-topology-together&quot;&gt;Qualify the software and topology together&lt;/h2&gt;

&lt;p&gt;Retain GPU, adapter and storage-controller identities, PCIe topology, kernel, GPU driver, CUDA/cuFile and filesystem-client versions. Include the mount and security configuration relevant to the supported path. A package list without the running kernel and modules is incomplete evidence.&lt;/p&gt;

&lt;p&gt;Review the platform’s required memory-sharing mechanism and module dependencies for the installed release. Do not infer that a module is always required, or always obsolete, from an example using a different CUDA version. Keep firmware and kernel changes within a supported combination.&lt;/p&gt;

&lt;p&gt;Use the installed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gdscheck&lt;/code&gt; tool according to that release’s help and &lt;a href=&quot;https://docs.nvidia.com/gpudirect-storage/troubleshooting-guide/index.html&quot;&gt;installation guide&lt;/a&gt;. Save its output as qualification evidence. A favorable capability check is a starting point; it does not prove the production application selected the same path.&lt;/p&gt;

&lt;h2 id=&quot;make-compatibility-mode-visible&quot;&gt;Make compatibility mode visible&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.nvidia.com/gpudirect-storage/o-direct-guide/index.html&quot;&gt;GDS O_DIRECT guide&lt;/a&gt; documents conditions relevant to direct I/O and compatibility behavior. Record whether fallback is allowed and how the installed tools report actual path use.&lt;/p&gt;

&lt;p&gt;Use cuFile statistics, supported logs or the relevant tool’s documented mode reporting to distinguish direct transfers from fallback. Compare the same file and mount under controlled conditions. Do not disable a safety fallback on a production workload simply to force a benchmark label to change.&lt;/p&gt;

&lt;p&gt;A diagnostic can intentionally test an unsupported target to confirm that the monitoring distinguishes it. Keep that negative test separate from the performance comparison. If both the known direct case and known fallback case produce indistinguishable telemetry, the evidence pipeline is not ready to support a path claim.&lt;/p&gt;

&lt;h2 id=&quot;control-the-benchmarks-other-moving-parts&quot;&gt;Control the benchmark’s other moving parts&lt;/h2&gt;

&lt;p&gt;Hold file contents, request sizes, alignment, concurrency and run duration constant. Record whether data is already cached and whether the working set exceeds relevant caches. A small repeated read can measure cache residency while being presented as storage performance.&lt;/p&gt;

&lt;p&gt;Separate single-transfer latency from sustained throughput. A path optimized for large sequential transfers may not help a workload issuing many small scattered reads. Choose an I/O pattern from the application’s observed behavior before selecting a synthetic test.&lt;/p&gt;

&lt;p&gt;Measure CPU use as well as data rate and GPU-side completion. Reduced CPU consumption may be valuable even when throughput is unchanged, particularly if the released CPU capacity helps decoding or MPI progress. State that benefit directly rather than inventing a throughput gain.&lt;/p&gt;

&lt;h2 id=&quot;compare-against-a-fair-host-staged-implementation&quot;&gt;Compare against a fair host-staged implementation&lt;/h2&gt;

&lt;p&gt;The baseline should use the same dataset, equivalent concurrency and a reasonable existing implementation. Comparing a tuned direct path with a deliberately serial baseline does not answer whether the site should change its production pipeline.&lt;/p&gt;

&lt;p&gt;Run both variants several times in an order that exposes warming effects. Save distributions and classify errors. Count failed transfers and retries in elapsed time rather than reporting only the intervals where everything worked.&lt;/p&gt;

&lt;p&gt;As an illustrative decision, suppose a storage microbenchmark becomes faster but training samples per second do not change. Investigate CPU decoding, batching, synchronization and GPU compute before expanding the deployment. The microbenchmark establishes a local capability; the application result determines its immediate value.&lt;/p&gt;

&lt;h2 id=&quot;include-correctness-and-interference&quot;&gt;Include correctness and interference&lt;/h2&gt;

&lt;p&gt;Validate the data that arrived, including short reads, errors and application-visible ordering. A benchmark can count bytes while the integration mishandles a partial operation. Use known content or application-level integrity checks appropriate to the test.&lt;/p&gt;

&lt;p&gt;Run a neighboring workload where the platform is shared. Changes in PCIe traffic, CPU availability or storage concurrency can affect another user even if the target workload improves. Test under an agreed operating envelope with a stop condition.&lt;/p&gt;

&lt;p&gt;Also measure checkpoint output separately. A successful read path does not establish write support, write durability or recovery correctness for every filesystem. Use the application’s checkpoint completion protocol and verify a reload before treating the platform as ready for long training runs.&lt;/p&gt;

&lt;h2 id=&quot;make-the-adoption-decision-about-the-whole-service&quot;&gt;Make the adoption decision about the whole service&lt;/h2&gt;

&lt;p&gt;Retain the supported configuration, direct/fallback evidence, benchmark definition, application outcome and rollback path. Estimate the maintenance burden of keeping the integration qualified through driver and filesystem upgrades.&lt;/p&gt;

&lt;p&gt;If a simpler host-staged path meets the workload’s requirements, keeping it can be the sound engineering choice. If GDS removes a measured bottleneck or frees a resource the application needs, deploy it first to a representative group and keep path observability in place.&lt;/p&gt;

&lt;p&gt;For input stages outside storage transport, see &lt;a href=&quot;/writing/pytorch-dataloader-bottlenecks-hpc-gpu-training/&quot;&gt;PyTorch data-loader bottlenecks&lt;/a&gt;. Faster bytes reaching device memory help only when the application can turn them into useful work.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>NVMe health and error logs: distinguish media wear, command failures and a broken path</title>
    <link href="https://www.wirewalk.com/writing/nvme-health-error-log-endurance-analysis/"/>
    <published>2026-04-29T10:00:00-04:00</published>
    <updated>2026-04-29T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nvme-health-error-log-endurance-analysis/</id>
    <summary>Interpret NVMe SMART and error records with device identity, units and interval deltas, then connect them to kernel events and application-visible failures.</summary>
    <content type="html">&lt;p&gt;A rising NVMe error-log count can accompany a failing drive. It can also reflect rejected administrative commands while ordinary data I/O remains healthy. Replacing hardware on the strength of that one number can leave the actual software or path problem untouched.&lt;/p&gt;

&lt;p&gt;Collect the device’s health information, detailed error records and host timeline together. Keep field scope and units intact. The useful question is which observation explains the application’s failure or the service risk you are trying to manage.&lt;/p&gt;

&lt;p&gt;These examples follow &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvme-cli&lt;/code&gt; 2.11-style commands and established standard log fields. Device-specific telemetry and newer command layouts require the documentation for the installed device and tool.&lt;/p&gt;

&lt;h2 id=&quot;preserve-a-baseline-with-identity-and-time&quot;&gt;Preserve a baseline with identity and time&lt;/h2&gt;

&lt;p&gt;Capture model, serial number, firmware, subsystem and namespace context with each collection. Include the host boot identity and observation timestamp. A counter difference is meaningful only if both samples describe the same resource and the expected counter lifecycle.&lt;/p&gt;

&lt;p&gt;Useful read-only snapshots include:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvme id-ctrl /dev/nvme0 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
nvme smart-log /dev/nvme0 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
nvme error-log /dev/nvme0 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; json
journalctl &lt;span class=&quot;nt&quot;&gt;-k&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--since&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;-30 minutes&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--no-pager&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Resolve the illustrative controller path before use. Log access requires appropriate permissions. Store kernel records privately where they contain workload paths or other infrastructure details.&lt;/p&gt;

&lt;p&gt;The pinned &lt;a href=&quot;https://github.com/linux-nvme/nvme-cli/blob/v2.11/Documentation/nvme-smart-log.txt&quot;&gt;SMART-log&lt;/a&gt; and &lt;a href=&quot;https://github.com/linux-nvme/nvme-cli/blob/v2.11/Documentation/nvme-error-log.txt&quot;&gt;error-log&lt;/a&gt; references describe the tool interfaces. Establish whether the requested health log is controller-wide or namespace-specific and whether that scope is supported. Opening a namespace block device should not be treated as proof that every returned counter belongs only to that namespace.&lt;/p&gt;

&lt;h2 id=&quot;read-health-fields-according-to-their-definition&quot;&gt;Read health fields according to their definition&lt;/h2&gt;

&lt;p&gt;Critical-warning bits, available spare, percentage used, media/data-integrity errors and unsafe-shutdown counts answer different questions. Keep the actual fields rather than collapsing them into one unsupported health score.&lt;/p&gt;

&lt;p&gt;Percentage used is a vendor estimate of endurance consumption; it is not the probability that the next I/O will fail and can exceed 100. Available spare and its threshold concern another part of the device’s reported health. Neither field establishes the integrity of every file already stored.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/linux-nvme/libnvme/blob/v1.11/src/nvme/types.h&quot;&gt;libnvme 1.11 field definitions&lt;/a&gt; provide a versioned reference for these established structures. Confirm vendor interpretation and supported reporting before building a fleet alert around a field that one device does not populate meaningfully.&lt;/p&gt;

&lt;p&gt;Check how the tool renders temperature. Raw fields and human-readable output may use different representations. Preserve units in the monitoring pipeline instead of assuming that a bare JSON number is already Celsius.&lt;/p&gt;

&lt;h2 id=&quot;keep-traffic-units-separate-from-physical-nand-writes&quot;&gt;Keep traffic units separate from physical NAND writes&lt;/h2&gt;

&lt;p&gt;Standard Data Units Read and Written use thousands of 512-byte units, with defined rounding. A single reported unit therefore represents 512,000 bytes at that reporting granularity, not one filesystem block.&lt;/p&gt;

&lt;p&gt;Use interval differences with that scaling when estimating host traffic. Retain large integer values without rounding them through an imprecise intermediate representation. Mark resets, replacements and missing readings so a negative difference does not become negative write traffic.&lt;/p&gt;

&lt;p&gt;Host-written data does not reveal the device’s internal physical write amplification by itself. A vendor-specific physical-media counter may provide additional information, but its definition and scope need separate validation. Do not divide two counters with different lifecycles and call the ratio a measured endurance property.&lt;/p&gt;

&lt;h2 id=&quot;investigate-individual-error-records&quot;&gt;Investigate individual error records&lt;/h2&gt;

&lt;p&gt;Inspect the status information and relevant context in the detailed error log. Distinguish media/data-integrity errors from invalid commands, unsupported fields, aborted operations and transport-related symptoms where the available evidence supports that distinction.&lt;/p&gt;

&lt;p&gt;A cumulative error-entry count is not a count of failed user reads. The detailed log has finite retention, and not every entry includes a useful timestamp or an application-level address. Capture it early in an incident, before routine collection or further errors obscure the relevant context.&lt;/p&gt;

&lt;p&gt;Keep the first observed application error and kernel event. Later controller resets, reconnects or filesystem errors can be consequences rather than the original cause. Build a timeline instead of assigning equal causal weight to every line containing the device name.&lt;/p&gt;

&lt;h2 id=&quot;separate-controller-health-from-pcie-or-fabric-health&quot;&gt;Separate controller health from PCIe or fabric health&lt;/h2&gt;

&lt;p&gt;A controller can report acceptable health fields while its PCIe path suffers link problems or its remote transport is unstable. Conversely, a healthy transport cannot compensate for a media failure inside the device.&lt;/p&gt;

&lt;p&gt;Correlate kernel timeout, reset, PCIe error and transport observations with the same interval. Record link topology and recent maintenance. Do not clear shared diagnostic counters merely to obtain a convenient zero baseline; use documented interval deltas where practical.&lt;/p&gt;

&lt;p&gt;Check application demand and host pressure as well. A long latency tail can arise from queueing, thermal operating constraints, firmware behavior or an overloaded service. Low percentage-used does not exclude those explanations.&lt;/p&gt;

&lt;h2 id=&quot;make-alerts-reflect-a-supported-operating-decision&quot;&gt;Make alerts reflect a supported operating decision&lt;/h2&gt;

&lt;p&gt;Separate immediate warnings from trends that support planned replacement. A new critical warning, recurring unrecovered integrity failures and slowly increasing endurance consumption deserve different actions and response times.&lt;/p&gt;

&lt;p&gt;Include identity, firmware, field change, affected workloads and relevant logs in the alert. A responder should be able to tell whether the drive was replaced yesterday or whether a collector began requesting an unsupported log page.&lt;/p&gt;

&lt;p&gt;Use vendor thresholds and the service’s redundancy and recovery requirements to decide the response. Avoid resetting a device or draining a whole fleet automatically because a single sampled value crossed an invented universal limit.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-recovery-with-data-and-workload-evidence&quot;&gt;Verify the recovery with data and workload evidence&lt;/h2&gt;

&lt;p&gt;When replacing or isolating a device, preserve the last readable evidence and the supported recovery path. Determine which outputs can be trusted using application completion and integrity rules, not just the return of a mount point.&lt;/p&gt;

&lt;p&gt;Re-run a bounded representative workload and inspect fresh interval counters afterward. A clean health snapshot immediately after reboot does not show that the original failure mode has been removed.&lt;/p&gt;

&lt;p&gt;For paths that share one namespace, pair this investigation with &lt;a href=&quot;/writing/nvme-multipath-ana-failure-validation/&quot;&gt;NVMe multipath and ANA testing&lt;/a&gt;. For controller software changes, retain the same before-and-after evidence through &lt;a href=&quot;/writing/nvme-firmware-slots-activation-maintenance/&quot;&gt;firmware maintenance&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>The green check that hides a broken result</title>
    <link href="https://www.wirewalk.com/writing/the-green-check-that-hides-a-broken-result/"/>
    <published>2026-04-22T10:00:00-04:00</published>
    <updated>2026-04-22T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/the-green-check-that-hides-a-broken-result/</id>
    <summary>In a mature estate the dangerous failures are not crashes. They are the runs where exit status is zero, the log looks clean, the file exists and the contents are wrong. A taxonomy of how that happens, and the checking discipline that catches it.</summary>
    <content type="html">&lt;p&gt;A crash is a gift. It has a timestamp, a stack, a non-zero status and somebody’s
attention. Crashes get fixed because they are impossible to ignore.&lt;/p&gt;

&lt;p&gt;The failures that survive in a well-run estate are the other kind. The job exits
zero. The log ends with “completed”. The output file is there, with the right
name, the right owner and a plausible size. Nothing in the monitoring turns
amber. And the contents are wrong — empty where they should be populated,
defaulted where you chose something else, stale where you expected fresh.&lt;/p&gt;

&lt;p&gt;The seven examples below show how these failures escape ordinary status checks. Each needs a check on the output or behavior, and a deliberate fault to prove the check can fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the output as well as the status.&lt;/strong&gt; A successful exit establishes that a process ran to completion; it may say nothing about whether it produced the intended result.&lt;/p&gt;

&lt;h2 id=&quot;the-taxonomy&quot;&gt;The taxonomy&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Class&lt;/th&gt;
      &lt;th&gt;What the operator sees&lt;/th&gt;
      &lt;th&gt;Why the probe passes&lt;/th&gt;
      &lt;th&gt;The assertion that catches it&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Error printed, status zero&lt;/td&gt;
      &lt;td&gt;An error line in a log nobody reads&lt;/td&gt;
      &lt;td&gt;Probe tests &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$?&lt;/code&gt; only&lt;/td&gt;
      &lt;td&gt;Compare stdout to an expected value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Plugin missing, schema intact&lt;/td&gt;
      &lt;td&gt;Correct headers, blank column&lt;/td&gt;
      &lt;td&gt;Header check passes&lt;/td&gt;
      &lt;td&gt;Assert a populated value for a case that must produce one&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;List parsed as one string&lt;/td&gt;
      &lt;td&gt;Silent fallback to a default&lt;/td&gt;
      &lt;td&gt;Config parses, service starts&lt;/td&gt;
      &lt;td&gt;Read the effective value back from the running process&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Zero-byte index fetched&lt;/td&gt;
      &lt;td&gt;“Nothing to update”&lt;/td&gt;
      &lt;td&gt;Transfer tool exits zero&lt;/td&gt;
      &lt;td&gt;Assert a minimum size and a known marker in the content&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Symlink to a path on another host&lt;/td&gt;
      &lt;td&gt;Module loads, variable empty&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module load&lt;/code&gt; exits zero&lt;/td&gt;
      &lt;td&gt;Resolve the path and test the binary runs&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Environment change inside a pipe&lt;/td&gt;
      &lt;td&gt;A working tool reported broken&lt;/td&gt;
      &lt;td&gt;Probe ran in a subshell&lt;/td&gt;
      &lt;td&gt;Set environment, then test in the same shell&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Suite that has never failed&lt;/td&gt;
      &lt;td&gt;An unbroken run of green&lt;/td&gt;
      &lt;td&gt;Nothing has been injected&lt;/td&gt;
      &lt;td&gt;Prove each check fails on a deliberate fault&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Each row below gets its own section, because the mechanism matters more than the
symptom.&lt;/p&gt;

&lt;h2 id=&quot;class-one-the-error-that-exits-zero&quot;&gt;Class one: the error that exits zero&lt;/h2&gt;

&lt;p&gt;Exit status is a convention, not a guarantee. Plenty of widely used tools print
a diagnostic and return success, either by design or by oversight.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jq&lt;/code&gt; is the honest case. A missing key is not an error in its data model — it is
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;null&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ echo &apos;{&quot;a&quot;:1}&apos; | jq -r &apos;.b&apos;
null
$ echo $?
0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A probe written as “run it, check the status, check that stdout is non-empty”
scores that as a pass. The string &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;null&lt;/code&gt; is four bytes of non-empty output.
Downstream, a config generator writes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;endpoint = null&lt;/code&gt; into a file, the service
parses it, and you get whatever the service does with a nonsense endpoint.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -c&lt;/code&gt; is the inverse and catches people the other way:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ printf &apos;&apos; | grep -c .
0
$ echo $?
1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It prints something (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0&lt;/code&gt;) and returns failure. A probe keying on status calls
that a failure when the count is the answer you wanted; a probe keying on “is
there output” calls it a pass. Neither is reading the number.&lt;/p&gt;

&lt;p&gt;The most expensive member of this family is HTTP. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl&lt;/code&gt; treats an HTTP error
response as a successful transfer, because from its point of view it was one:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ curl -s -o index.json -w &apos;http=%{http_code}\n&apos; https://example.com/api/index.json
http=404
$ echo $?
0
$ ls -l index.json
-rw-r--r-- 1 svc svc 559 Apr 22 09:14 index.json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The file exists. It is 559 bytes. It is an HTML error page. Every “the file was
created and is non-empty” check passes. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl --fail&lt;/code&gt; suppresses the body on a
4xx or 5xx and exits non-zero, which is what you want in a script;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fail-with-body&lt;/code&gt; (curl 7.76 and later) does the same but keeps the body if you
need it for the log. Neither is the default, and the default is what ends up in
automation written in a hurry.&lt;/p&gt;

&lt;p&gt;One caveat, because it bites checks that are too specific. The documented exit
code for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fail&lt;/code&gt; is 22, and over HTTP/1.1 that is what you get. Over HTTP/2 the
same 404 can surface as 56 instead, because curl tears the stream down and
reports a receive error rather than an HTTP one:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ curl -s --fail -o /dev/null https://example.com/api/index.json ; echo $?
56
$ curl -s --http1.1 --fail -o /dev/null https://example.com/api/index.json ; echo $?
22
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That pair is from curl 8.7.1, and I would treat the specific code as
build- and version-dependent rather than a rule — which is exactly the point.
Test &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fail&lt;/code&gt; for non-zero, not for 22. A check written as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[ $? -eq 22 ]&lt;/code&gt; is
itself a member of this article’s taxonomy: it goes green on the day the
negotiated protocol, or the packaged curl, changes under it.&lt;/p&gt;

&lt;p&gt;The general fix is not to distrust exit codes. It is to stop treating them as
the only evidence. Ask for the value, state what you expect, compare.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;got=$(jq -r &apos;.endpoint // empty&apos; config.json)
[ &quot;$got&quot; = &quot;https://collector.internal:8443&quot; ] || {
  echo &quot;endpoint mismatch: got [$got]&quot; &amp;gt;&amp;amp;2; exit 1; }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That check can fail for a reason other than the process crashing, which is the
only property that makes it a check.&lt;/p&gt;

&lt;h2 id=&quot;class-two-the-plugin-that-does-not-load&quot;&gt;Class two: the plugin that does not load&lt;/h2&gt;

&lt;p&gt;This is the one that has cost me the most time, because the output looks
completely normal.&lt;/p&gt;

&lt;p&gt;Many tools declare their output schema separately from the code that populates
it. The formatter knows the column is called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt;. Whether anything ever
writes a number into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; depends on a collector, a plugin or an accounting
module that may not be configured at all. When it is not, you do not get an
error. You get the column, with nothing in it.&lt;/p&gt;

&lt;p&gt;Slurm’s accounting is the canonical example. Ask for per-job memory:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sacct -j 1847221 --format=JobID,JobName,Elapsed,MaxRSS,AveCPU
JobID           JobName    Elapsed     MaxRSS     AveCPU
------------ ---------- ---------- ---------- ----------
1847221         run.sh     02:14:07
1847221.bat+      batch    02:14:07     8412K   02:11:53
1847221.0        python    02:13:44  41235280K  02:11:40
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now the same query with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-X&lt;/code&gt;, which restricts output to allocation records:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sacct -X -j 1847221 --format=JobID,JobName,Elapsed,MaxRSS,AveCPU
JobID           JobName    Elapsed     MaxRSS     AveCPU
------------ ---------- ---------- ---------- ----------
1847221         run.sh     02:14:07
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaxRSS&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AveCPU&lt;/code&gt; are gathered per step and stored on step records. The
allocation record has the columns and no values. A reporting script written
around &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct -X&lt;/code&gt; — a reasonable choice, since it gives one row per job — will
produce a memory report for the whole fleet in which every single job used no
memory. The header row is correct. The CSV parses. The chart renders. It is
entirely empty of information and looks like a finding.&lt;/p&gt;

&lt;p&gt;The same shape occurs with a metrics exporter whose collector throws. The
exporter keeps serving &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/metrics&lt;/code&gt;; the failed collector’s series are simply
absent. Any alert of the form &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rate(thing_total[5m]) &amp;gt; 0&lt;/code&gt; on a series that no
longer exists evaluates against an empty vector and never fires. The alert is
not firing and the thing it watches is unmonitored, and those two states are
indistinguishable on the dashboard. That is what &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;absent()&lt;/code&gt; and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;absent_over_time()&lt;/code&gt; are for, and why a rule that watches a metric should
usually be paired with a rule that watches for the metric’s disappearance.&lt;/p&gt;

&lt;p&gt;The assertion that catches the whole family is the same: &lt;strong&gt;pick a case that must
produce a populated value, and assert on the value.&lt;/strong&gt; Not on the header, not on
the row count, not on the file size.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# a job you know allocated real memory; --noconvert keeps every value in K,
# so you are not comparing 8412K against 39.33G as strings
rss=$(sacct -n -j &quot;$JOB&quot; --format=MaxRSS -P --noconvert \
      | tr -d &apos;K &apos; | grep -E &apos;^[0-9]+$&apos; | sort -n | tail -1)
[ -n &quot;$rss&quot; ] &amp;amp;&amp;amp; [ &quot;$rss&quot; -gt 1000 ] || {
  echo &quot;accounting returned no MaxRSS for a job that used memory&quot; &amp;gt;&amp;amp;2; exit 1; }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two details in that snippet are load-bearing, and both are easy to get wrong in
a way that leaves the check passing. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--noconvert&lt;/code&gt; matters because newer Slurm
renders large values in human units — a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sort -n&lt;/code&gt; over a mixture of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;8412K&lt;/code&gt; and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;39.33G&lt;/code&gt; puts the small number last. And the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -E &apos;^[0-9]+$&apos;&lt;/code&gt; matters
because step records without a value emit a blank line: strip newlines along
with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;K&lt;/code&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tr -d &apos;K \n&apos;&lt;/code&gt;, which is the form that comes naturally) and every
row concatenates into one integer.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ printf &apos;8412K\n41235280K\n\n&apos; | tr -d &apos;K \n&apos; | sort -n | tail -1
841241235280
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That number is larger than any threshold you would set, so the check passes
forever, on any input, including no input at all.&lt;/p&gt;

&lt;h3 id=&quot;the-interpretation-that-is-wrong&quot;&gt;The interpretation that is wrong&lt;/h3&gt;

&lt;p&gt;A worked example, because this is where the trap closes.&lt;/p&gt;

&lt;p&gt;A CPU-efficiency report built on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct&lt;/code&gt; produced a fleet average of exactly
1.00. Every user, every partition, every month. The obvious reading is a
perfectly tuned estate. The correct reading is that the two quantities being
divided are the same quantity.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt; is allocated CPU time: elapsed seconds multiplied by allocated
cores. It is not consumed CPU time. Divide &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt; by itself, or by any
other allocation-derived figure, and you get 1.0 by construction, for every job
that has ever run. The consumed figure is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; (system plus user), and it
lives on step records — so the “one row per job” convenience of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-X&lt;/code&gt; gives you
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; of zero, and an efficiency of 0.00 for everything. Two different
wrong answers, each uniform enough to look like a real property of the fleet.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# wrong: always 1.00 — CPUTime is CPUTimeRAW in a different notation
sacct -X -a -S 2026-03-01 --format=JobID,CPUTimeRAW,CPUTime -P

# workable: consumed over allocated, steps included
sacct -a -S 2026-03-01 --format=JobID,TotalCPU,CPUTimeRAW -P
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Mind the units when you divide those two. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPUTimeRAW&lt;/code&gt; is an integer count of
CPU-seconds; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TotalCPU&lt;/code&gt; is a formatted duration, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[DD-]HH:MM:SS[.mmm]&lt;/code&gt;. Divide
the string by the integer without parsing it and you will get a number — a
small, uniform, entirely fictitious one — which is the same failure this section
is about, arrived at one layer further down.&lt;/p&gt;

&lt;p&gt;Uniformity is the signal. A real efficiency distribution on a shared cluster is
wide and messy, and the mean lands somewhere below half — I would treat
roughly 30 to 60 percent as the plausible band for a general-purpose fleet, and
I am giving that as a band rather than a figure because it depends heavily on
the workload mix and I have no basis for a tighter claim. What I am confident
about is the mechanism: if a derived metric is the same for every row, suspect
the arithmetic before you believe the estate.&lt;/p&gt;

&lt;h2 id=&quot;class-three-the-list-that-is-one-string&quot;&gt;Class three: the list that is one string&lt;/h2&gt;

&lt;p&gt;Configuration parsers disagree about lists. Some split on whitespace, some on
commas, some take the whole line, and some accept either and quietly prefer the
wrong one. When a list is read as a single literal, it usually matches nothing,
and “matches nothing” is frequently indistinguishable from “not configured” —
which means a fallback to a default you did not choose.&lt;/p&gt;

&lt;p&gt;The shell version is the one everyone has written:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ L=&quot;mlx5_0 mlx5_1&quot;
$ for p in &quot;$L&quot;; do echo &quot;iter: [$p]&quot;; done
iter: [mlx5_0 mlx5_1]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One iteration, one token containing a space, and any lookup keyed on it fails.
Unquoted it splits into two; quoted it does not. Both are correct for some
purpose, and the difference is invisible in the log because the loop body ran
and exited zero.&lt;/p&gt;

&lt;p&gt;The config-file version is more insidious because the file passes validation.
OpenSSH’s server config, for most keywords, uses the first value obtained and
ignores later ones. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sshd -t&lt;/code&gt; reports the file is fine. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemctl reload sshd&lt;/code&gt;
succeeds. Your carefully placed directive at the bottom of the file does nothing
at all, because something 200 lines above set it first — often a vendor-shipped
include you did not write. The only reliable check is to ask the running daemon
what it actually believes:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# run as root; sshd -T reads the host keys
# sshd 9.8 and later ship as a split binary, but -T still lives on sshd itself
$ sudo sshd -T | grep -i &apos;^ciphers&apos;
ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sshd -T&lt;/code&gt; prints the effective configuration after all parsing and includes. The
file is what you wrote; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-T&lt;/code&gt; is what is true.&lt;/p&gt;

&lt;p&gt;One qualification, because it is the reading people get wrong: bare &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sshd -T&lt;/code&gt;
prints the configuration for a connection that matches no &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Match&lt;/code&gt; block. If the
directive you care about lives inside a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Match Group&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Match Address&lt;/code&gt;, plain
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-T&lt;/code&gt; will not show it and you will conclude, wrongly, that it never took. Supply
the connection you are asking about:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo sshd -T -C user=svc,host=jump.example.com,addr=203.0.113.10 | grep -i &apos;^permitrootlogin&apos;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The output is the effective value &lt;em&gt;for that connection&lt;/em&gt;. There is no single
effective value for a config with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Match&lt;/code&gt; blocks in it, and a check that assumes
there is will be right for most users and quietly wrong for the ones the block
was written for.&lt;/p&gt;

&lt;p&gt;The general form: where a service distinguishes between the file it was given
and the configuration it is running, the effective-value output is the only
thing worth asserting on, and you must ask it about the specific case you care
about. Where a service offers no such output, read the value back through
whatever interface it does expose — a status command, an admin socket, an API —
and compare it to the value you intended, in writing, in the check.&lt;/p&gt;

&lt;h2 id=&quot;class-four-the-zero-byte-index&quot;&gt;Class four: the zero-byte index&lt;/h2&gt;

&lt;p&gt;A package index, a manifest, a rule feed and a firmware catalog all share a
property: when they arrive empty, the consuming tool reports that there is
nothing to do.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ curl -s -o /var/cache/feed/index.json -w &apos;http=%{http_code} size=%{size_download}\n&apos; \
    https://feeds.example.com/v2/index.json
http=200 size=0
$ echo $?
0
$ ls -l /var/cache/feed/index.json
-rw-r--r-- 1 root root 0 Apr 22 03:00 /var/cache/feed/index.json
$ ./apply-feed --index /var/cache/feed/index.json
0 entries loaded, 0 applied, 0 errors
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three zeros and a clean exit. Read it out loud: nothing to apply, so nothing was
applied, so no errors. That is a correct description of a broken pipeline.&lt;/p&gt;

&lt;p&gt;Note what that transcript is and is not, because the failure modes here do not
rank the way intuition ranks them. It is a 200 with an empty body — a
half-deployed origin, a proxy serving a truncated cache entry, a signing step
that produced nothing. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fail&lt;/code&gt; does not save you, because there is no HTTP
error to fail on: the transfer genuinely succeeded and what succeeded was
nothing.&lt;/p&gt;

&lt;p&gt;The counter-intuitive part is which failure is worse for the file on disk. A
transport failure is the gentle one — curl exits non-zero and leaves an existing
destination untouched, so the last good copy survives:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ echo &quot;PREVIOUS GOOD CONTENT&quot; &amp;gt; index.json
$ curl -s -o index.json https://feeds.example.invalid/v2/index.json ; echo $?
6
$ cat index.json
PREVIOUS GOOD CONTENT
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;An HTTP error without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fail&lt;/code&gt; is the destructive one. The transfer succeeds, so
curl writes, and the error page lands on top of the only good copy you had:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ curl -s -o index.json https://example.com/api/index.json ; echo $?
0
$ ls -l index.json
-rw-r--r-- 1 root root 559 Apr 22 03:00 index.json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Adding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fail&lt;/code&gt; restores the gentle behavior — non-zero status, destination
left alone. Which reframes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fail&lt;/code&gt; from a tidiness flag into a data-protection
one: without it, every scheduled fetch is one origin misconfiguration away from
overwriting a good cache with an error page, at three in the morning, exiting
zero.&lt;/p&gt;

&lt;p&gt;The reason this survives is that “no changes” is also the normal steady state.
On most days the honest answer genuinely is “0 applied”. A check that only
alarms on errors will never distinguish “we are current” from “we are blind”,
and the second state can persist for months.&lt;/p&gt;

&lt;p&gt;Two assertions, both cheap:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# 1. minimum plausible size, not merely non-empty
# (GNU coreutils; on BSD/macOS the equivalent is stat -f %z)
sz=$(stat -c %s /var/cache/feed/index.json)
[ &quot;$sz&quot; -ge 4096 ] || { echo &quot;index implausibly small: ${sz}B&quot; &amp;gt;&amp;amp;2; exit 1; }

# 2. a structural marker, not just bytes
jq -e &apos;.entries | length &amp;gt; 0&apos; /var/cache/feed/index.json &amp;gt;/dev/null || {
  echo &quot;index parsed but contains no entries&quot; &amp;gt;&amp;amp;2; exit 1; }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And one more that is worth the trouble on anything time-sensitive: assert on the
age of the content, not the age of the file. Any transfer that opens the
destination before it knows the result — a 200 that dies half way through the
body, an error page written over a good cache — leaves you a fresh mtime over
bytes that are stale, partial or wrong. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find -mtime&lt;/code&gt; is then measuring when
something was written, not when it was current. If the payload carries a
generation timestamp, compare that instead, and treat the file’s own mtime as
evidence of nothing but write activity.&lt;/p&gt;

&lt;h2 id=&quot;class-five-the-symlink-that-resolves-nowhere&quot;&gt;Class five: the symlink that resolves nowhere&lt;/h2&gt;

&lt;p&gt;Shared software trees accumulate links. A module file or a wrapper script points
at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/opt/apps/tool/current&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;current&lt;/code&gt; points at a release directory, and at
some point a release directory is moved, or the link is created on a build host
against a path that only exists there.&lt;/p&gt;

&lt;p&gt;The link itself is not broken in any way the filesystem will tell you about.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ln -s&lt;/code&gt; will happily create a link to a path that does not exist. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls&lt;/code&gt; shows it.
And the module that consumes it does this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;prepend-path PATH    $prefix/bin
prepend-path LD_LIBRARY_PATH $prefix/lib64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$prefix&lt;/code&gt; was computed by resolving the link. If the resolution produced
an empty string, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; gains the entry &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/bin&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LD_LIBRARY_PATH&lt;/code&gt; gains
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/lib64&lt;/code&gt;. Both are real directories. Neither errors. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module load&lt;/code&gt; exits zero,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module list&lt;/code&gt; shows the module loaded, and the binary you wanted is not on the
path — so you get the system’s version, silently, at a different version than
the one the module claims.&lt;/p&gt;

&lt;p&gt;The distinguishing commands:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ls -l /opt/apps/tool/current
lrwxrwxrwx 1 root root 33 Feb 11 16:02 /opt/apps/tool/current -&amp;gt; /build/stage/opt/apps/tool/3.11.2

$ readlink -e /opt/apps/tool/current
$ echo $?
1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;readlink -e&lt;/code&gt; requires every component of the resolved path to exist and prints
nothing when it does not. For a check, that is the flag you want.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;readlink -f&lt;/code&gt; is the one usually reached for, and the difference is worth
spelling out because the obvious summary of it is wrong. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-f&lt;/code&gt; is not “the same
but it does not check”. It requires every component &lt;em&gt;but the last&lt;/em&gt; to exist. So
its behavior splits by which part of the target went missing:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# release directory pruned; the parent is still there → -f is happy, -e is not
$ readlink -f /opt/apps/tool/releases/3.11.2
/opt/apps/tool/releases/3.11.2
$ echo $?
0
$ readlink -e /opt/apps/tool/releases/3.11.2 ; echo $?
1

# link written on a build host; /build/stage does not exist here at all
$ readlink -f /opt/apps/tool/current ; echo $?
1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which means a check built on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-f&lt;/code&gt; catches the build-host case and misses the
pruned-release case — and the pruned release is the one that happens on a
schedule. It fails in the direction that looks fine.&lt;/p&gt;

&lt;p&gt;Both flags are GNU coreutils. BSD and macOS &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;readlink&lt;/code&gt; has no &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-e&lt;/code&gt; at all, and
its &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-f&lt;/code&gt; does not behave like the GNU one, so a check that runs on a mixed
estate should use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;test -e &quot;$(readlink -f …)&quot;&lt;/code&gt; or simply
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[ -e /opt/apps/tool/current ]&lt;/code&gt;, which follows the link and answers the question
directly.&lt;/p&gt;

&lt;p&gt;The assertion is not “does the module load”. It is “after loading, does the
thing run and say the right version”:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;module purge
module load tool/3.11.2
command -v tool | grep -q &apos;^/opt/apps/&apos; || { echo &quot;tool not from /opt/apps&quot; &amp;gt;&amp;amp;2; exit 1; }
tool --version | grep -q &apos;3\.11\.2&apos;     || { echo &quot;wrong tool version&quot; &amp;gt;&amp;amp;2; exit 1; }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two lines, and they fail for the right reasons: wrong location, wrong version.&lt;/p&gt;

&lt;h2 id=&quot;class-six-the-environment-change-inside-a-pipe&quot;&gt;Class six: the environment change inside a pipe&lt;/h2&gt;

&lt;p&gt;This one is the mirror image of the rest. Here the estate is fine and the check
is wrong, and the natural conclusion — “the module is broken” — sends you off to
rebuild something that was never damaged.&lt;/p&gt;

&lt;p&gt;In bash, every element of a pipeline runs in a subshell by default. Anything it
does to the environment dies with it:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ x=1
$ echo hi | { x=2; }
hi
$ echo &quot;x=$x&quot;
x=1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;“By default” is doing real work in that sentence, and this is the one place in
the article where the portable-looking rule is the unportable one. Bash exempts
the last stage if &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lastpipe&lt;/code&gt; is set and job control is off — the usual state of
a non-interactive script. zsh and ksh93 run the last stage in the current shell
unconditionally:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bash -c &apos;echo hi | read y; echo &quot;bash y=[$y]&quot;&apos;
bash y=[]
$ zsh  -c &apos;echo hi | read y; echo &quot;zsh y=[$y]&quot;&apos;
zsh y=[hi]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So the same validation script, interpreted by a different shell, produces a
different verdict about whether the estate is broken. Neither shell is wrong.
Pin the interpreter in the shebang and do not rely on which side of that line
you are on.&lt;/p&gt;

&lt;p&gt;Now the operational version. A validation script wants to load a module and
capture the result:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;module load fftw/3.3.10 | tee -a validate.log
echo &quot;FFTW_DIR=[$FFTW_DIR]&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;module&lt;/code&gt; is a shell function. Inside the pipe it runs in a subshell, sets its
variables there, and the subshell exits. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FFTW_DIR&lt;/code&gt; is empty in the parent. The
script concludes the module sets nothing and reports a broken module. A second
engineer loads it by hand, it works perfectly, and the disagreement gets
attributed to “something about the environment”.&lt;/p&gt;

&lt;p&gt;The same mechanism hides real failures too:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bash -c &apos;false | true; echo &quot;rc=$?&quot;&apos;
rc=0
$ bash -c &apos;set -o pipefail; false | true; echo &quot;rc=$?&quot;&apos;
rc=1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pipefail&lt;/code&gt;, a pipeline reports the status of its last command only. Pipe
a failing producer into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tee&lt;/code&gt; and the failure is gone. This is why so much
automation that pipes its output to a log has no idea when it failed.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set -e&lt;/code&gt; has its own blind spot in the same family:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bash -c &apos;set -eu; f(){ local v=$(false); echo &quot;inside rc=$? v=[$v]&quot;; }; f; echo after&apos;
inside rc=0 v=[]
after
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;local&lt;/code&gt; is itself a command, and its exit status is the status of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;local&lt;/code&gt;, not
of the substitution inside it. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;export&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;declare&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;readonly&lt;/code&gt; swallow a
failure the same way, for the same reason:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bash -c &apos;set -eu; export v=$(false); echo &quot;reached&quot;&apos;
reached
$ bash -c &apos;set -eu; declare v=$(false); echo &quot;reached&quot;&apos;
reached
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Split the declaration from the assignment and the same script stops:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bash -c &apos;set -eu; f(){ local v; v=$(false); echo &quot;never reached&quot;; }; f&apos;
$ echo $?
1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One more in the same category, worth knowing because it appears in cleanup and
maintenance scripts — and worth stating carefully, because the usual version of
this folklore is half true. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find -exec cmd {} \;&lt;/code&gt; returns zero even when every
invocation of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cmd&lt;/code&gt; fails. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find -exec cmd {} +&lt;/code&gt; does not: in GNU findutils a
non-zero invocation makes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find&lt;/code&gt; itself exit non-zero.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ find /tmp/fecheck -type f -exec false {} \; ; echo &quot;semicolon rc=$?&quot;
semicolon rc=0
$ find /tmp/fecheck -type f -exec false {} +  ; echo &quot;plus rc=$?&quot;
plus rc=1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The terminator, not the tool, decides whether failures propagate. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xargs&lt;/code&gt; also
reports them — GNU &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xargs&lt;/code&gt; exits 123 if any invocation exits 1 to 125 — so if a
maintenance script’s success depends on the command being run, use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;+&lt;/code&gt; or
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xargs&lt;/code&gt;, and do not read anything into the status of a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\;&lt;/code&gt; form.&lt;/p&gt;

&lt;p&gt;The rule that covers all of it, for any harness you write:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;set -Eeuo pipefail
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;plus: do not put environment-modifying commands in pipelines, and do not hide a
command substitution inside a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;local&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;declare&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;export&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;class-seven-the-suite-that-has-never-failed&quot;&gt;Class seven: the suite that has never failed&lt;/h2&gt;

&lt;p&gt;The last class is not a bug. It is the reason the other six survive.&lt;/p&gt;

&lt;p&gt;A validation suite that has returned green on every run since it was written has
demonstrated exactly one thing: that it returns green. It has never been shown
to be capable of returning anything else. If half its assertions were deleted
tonight, tomorrow’s run would be identical, and you would never know.&lt;/p&gt;

&lt;p&gt;This is the same argument as the one for restore drills and for fire alarms with
a test button. A detector that has never been triggered under controlled
conditions is decoration until proven otherwise.&lt;/p&gt;

&lt;p&gt;The fix is negative controls: for every check, construct the fault it claims to
detect, run the check, and require that it fails. Keep those injections in the
repository next to the suite, and run them on a schedule.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#!/usr/bin/env bash
# negctl.sh — prove each check can fail
set -Eeuo pipefail

fixtures=/var/lib/validate/fixtures
fail=0

expect_fail() {           # expect_fail &amp;lt;label&amp;gt; &amp;lt;cmd...&amp;gt;
  local label=$1; shift
  if &quot;$@&quot; &amp;gt;/dev/null 2&amp;gt;&amp;amp;1; then
    echo &quot;NEGATIVE CONTROL DID NOT FIRE: $label&quot;
    fail=1
  else
    echo &quot;ok (failed as required): $label&quot;
  fi
}

expect_fail &quot;empty index rejected&quot;      check_index &quot;$fixtures/index.empty.json&quot;
expect_fail &quot;html error page rejected&quot;  check_index &quot;$fixtures/index.404.html&quot;
expect_fail &quot;truncated index rejected&quot;  check_index &quot;$fixtures/index.truncated.json&quot;
expect_fail &quot;blank MaxRSS rejected&quot;     check_accounting &quot;$fixtures/sacct.blank.csv&quot;
expect_fail &quot;dangling symlink rejected&quot; check_prefix   &quot;$fixtures/dangling-link&quot;
expect_fail &quot;wrong version rejected&quot;    check_version  &quot;$fixtures/tool-3.10.0&quot;

exit &quot;$fail&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The fixtures matter as much as the script. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;index.404.html&lt;/code&gt; should be a real
error page you captured, not one you typed; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sacct.blank.csv&lt;/code&gt; should be real
output from a query that really did return blank columns. Saving the broken
artefact at the moment you find it is the cheapest thing in this article and the
one most often skipped.&lt;/p&gt;

&lt;p&gt;There is a second-order benefit. Running the negative controls tells you when a
check has quietly stopped being able to fail — because someone loosened a
threshold, or because the tool’s output format changed and a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep&lt;/code&gt; that used to
match now matches nothing and the surrounding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;|| true&lt;/code&gt; swallows it.&lt;/p&gt;

&lt;h2 id=&quot;the-discipline-condensed&quot;&gt;The discipline, condensed&lt;/h2&gt;

&lt;p&gt;Four rules, in the order they pay off.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assert on content, not on status.&lt;/strong&gt; Exit zero means the process reached its
own idea of the end. It says nothing about the bytes it produced. Every check
should name a value it expects and compare.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Write the expected value down in the check.&lt;/strong&gt; Not “non-empty”, not “more than
zero rows” — the actual string, the actual minimum, the actual version. A check
that does not encode an expectation cannot detect a wrong answer, only a missing
one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick a case that must produce a populated result.&lt;/strong&gt; The whole plugin-shaped
failure class hides behind aggregate checks. One known job, one known file, one
known value, asserted exactly, is worth more than a thousand rows counted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prove every check can fail.&lt;/strong&gt; If you cannot show the injected fault that turns
it red, it is not a check. Delete it or fix it, because leaving it there is
worse than having nothing — it produces the feeling of coverage without the
coverage.&lt;/p&gt;

&lt;p&gt;And one habit underneath all four: when a number is uniform across every row, or
a report is empty on a day when it should not be, or a pipeline says “0 applied”
for the ninth week running, treat that as a finding about the measurement rather
than a finding about the estate. In my experience the uniform answer is wrong far
more often than it is right.&lt;/p&gt;

&lt;h2 id=&quot;what-this-does-not-cover&quot;&gt;What this does not cover&lt;/h2&gt;

&lt;p&gt;Nothing here detects a computation that is wrong in a plausible way — output
that is populated, well-formed and numerically incorrect. That needs a reference
result, a known-answer test or an independent implementation, and it is a
different and harder problem.&lt;/p&gt;

&lt;p&gt;Nor does any of it help if the check and the thing being checked share a
dependency. A probe that reads the same broken index, or resolves the same
dangling link, or inherits the same empty variable, will agree with the system
perfectly. When you build a negative control, inject the fault as far upstream as
you can reach, and confirm the alarm travels all the way to the place a human
would actually see it. A check nobody reads is the same as a check that cannot
fail, arrived at by a different route.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Debugging CUDA failures with CUDA-GDB and Compute Sanitizer</title>
    <link href="https://www.wirewalk.com/writing/cuda-gdb-compute-sanitizer-correctness/"/>
    <published>2026-04-22T10:00:00-04:00</published>
    <updated>2026-04-22T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/cuda-gdb-compute-sanitizer-correctness/</id>
    <summary>Reduce CUDA failures to a reproducible case, separate host and device errors, choose the right sanitizer, and preserve optimized behavior when a debug build hides the fault.</summary>
    <content type="html">&lt;p&gt;An illegal device access often becomes visible at a later synchronization call. The host stack then points to where the application noticed the problem, which may be far from the kernel that caused it. Editing that last visible line can waste hours while leaving the original defect intact.&lt;/p&gt;

&lt;p&gt;A useful CUDA investigation preserves the failing input and execution environment, establishes an observation boundary, and uses the smallest tool that can answer the next question. A debugger helps inspect state. A sanitizer detects particular classes of incorrect behavior. Neither makes a debug build equivalent to the production executable.&lt;/p&gt;

&lt;h2 id=&quot;preserve-a-failure-that-another-person-can-reproduce&quot;&gt;Preserve a failure that another person can reproduce&lt;/h2&gt;

&lt;p&gt;Record the executable and source revision, build flags, CUDA runtime, host driver, GPU identity and input. Include the launcher and container digest where applicable. Keep the ordinary allocation context: a test on an otherwise idle interactive GPU may omit the streams, concurrency or memory pressure involved in the original failure.&lt;/p&gt;

&lt;p&gt;Reduce input size and iteration count gradually, confirming that the failure still occurs after each reduction. Save the last reproducing case. If the problem depends on a particular batch size or ordering, that dependency is part of the evidence rather than an inconvenience to remove.&lt;/p&gt;

&lt;p&gt;Check CUDA API return values and kernel-launch errors in the application. Establish where asynchronous errors are first observed. A temporary synchronization boundary can help localize a failure, but it changes execution timing and should be labeled as a diagnostic modification.&lt;/p&gt;

&lt;h2 id=&quot;keep-host-and-device-debugging-builds-separate&quot;&gt;Keep host and device debugging builds separate&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.nvidia.com/cuda/archive/12.8.0/cuda-gdb/index.html&quot;&gt;NVIDIA’s CUDA-GDB 12.8 guide&lt;/a&gt; describes debugging information and device execution controls. A small illustrative build pair is:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvcc &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-G&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; solver-debug solver.cu
nvcc &lt;span class=&quot;nt&quot;&gt;-O3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lineinfo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; solver-profile solver.cu
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The source and executable names are placeholders. Preserve the real program’s required architecture, include and link options. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-G&lt;/code&gt; enables device debugging and can substantially change generated code and optimization behavior. Line information in an optimized build helps attribution but does not provide the same variable visibility as a device-debug build.&lt;/p&gt;

&lt;p&gt;Give the variants different paths and retain their identities with reports. A core file or sanitizer log associated with the wrong executable can look like corrupt state even when the real problem is a symbol mismatch.&lt;/p&gt;

&lt;h2 id=&quot;choose-a-sanitizer-for-the-suspected-failure&quot;&gt;Choose a sanitizer for the suspected failure&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.nvidia.com/compute-sanitizer/ComputeSanitizer/index.html&quot;&gt;Compute Sanitizer documentation&lt;/a&gt; distinguishes its tools. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;memcheck&lt;/code&gt; addresses device memory-access and related errors; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;racecheck&lt;/code&gt; focuses on shared-memory data hazards; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;initcheck&lt;/code&gt; checks uninitialized device global-memory accesses; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;synccheck&lt;/code&gt; examines supported synchronization misuse.&lt;/p&gt;

&lt;p&gt;Use that scope when interpreting a clean run. Shared-memory hazard detection is not a guarantee that every global-memory communication protocol is correct. A synchronization checker is not a general proof that a distributed program cannot deadlock.&lt;/p&gt;

&lt;p&gt;For a bounded reproducer, separate runs might use:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;compute-sanitizer &lt;span class=&quot;nt&quot;&gt;--tool&lt;/span&gt; memcheck &lt;span class=&quot;nt&quot;&gt;--error-exitcode&lt;/span&gt; 99 ./solver-debug
compute-sanitizer &lt;span class=&quot;nt&quot;&gt;--tool&lt;/span&gt; racecheck &lt;span class=&quot;nt&quot;&gt;--error-exitcode&lt;/span&gt; 99 ./solver-debug
compute-sanitizer &lt;span class=&quot;nt&quot;&gt;--tool&lt;/span&gt; initcheck &lt;span class=&quot;nt&quot;&gt;--error-exitcode&lt;/span&gt; 99 ./solver-debug
compute-sanitizer &lt;span class=&quot;nt&quot;&gt;--tool&lt;/span&gt; synccheck &lt;span class=&quot;nt&quot;&gt;--error-exitcode&lt;/span&gt; 99 ./solver-debug
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Confirm the installed release’s supported features and command options. Start with memory-access failures before building explanations around later corrupted values. Record tool output and the application’s own status; the configured exit code makes detected errors easier to distinguish in an automated test.&lt;/p&gt;

&lt;h2 id=&quot;inspect-the-right-gpu-execution-context&quot;&gt;Inspect the right GPU execution context&lt;/h2&gt;

&lt;p&gt;Launch the reproducer under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cuda-gdb&lt;/code&gt; and stop near the suspected operation. Identify the active kernel and relevant device threads rather than assuming that the debugger’s current host thread represents the device failure.&lt;/p&gt;

&lt;p&gt;A basic interactive session can start with:&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(cuda-gdb) break main
(cuda-gdb) run
(cuda-gdb) info cuda kernels
(cuda-gdb) info cuda threads
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Inspect the release’s CUDA-specific focus controls before selecting a block, warp or lane. A value printed from one execution context does not describe every thread. Examine the address calculation, bounds and launch dimensions for the failing context, then compare them with a context that behaves correctly.&lt;/p&gt;

&lt;p&gt;Avoid printing a large device buffer indiscriminately. It can slow the session and expose research data in logs. Retain only the state needed to explain the defect, with the full reproducer stored through the team’s normal protected workflow.&lt;/p&gt;

&lt;h2 id=&quot;investigate-failures-that-disappear-under-instrumentation&quot;&gt;Investigate failures that disappear under instrumentation&lt;/h2&gt;

&lt;p&gt;Sanitizers, breakpoints and debug compilation alter timing. A race can disappear because accesses are delayed or serialized; an out-of-bounds write can land differently after allocation layout changes. Success under a debugger is therefore a change in observed behavior, not closure.&lt;/p&gt;

&lt;p&gt;Compare optimized builds with and without the diagnostic changes. Keep input, launch geometry and resource requests fixed where possible. Look for missing synchronization, premature buffer reuse, incorrect stream dependencies and lifetime errors at host/device boundaries.&lt;/p&gt;

&lt;p&gt;Add a targeted invariant that checks the suspected contract, such as a valid index range or completion before reuse. The check should fail near the cause and produce enough context to distinguish attempts. Remove broad synchronization added solely for localization once the actual dependency is corrected, then retest.&lt;/p&gt;

&lt;h2 id=&quot;separate-a-software-defect-from-a-hardware-incident&quot;&gt;Separate a software defect from a hardware incident&lt;/h2&gt;

&lt;p&gt;A device exception alone does not prove faulty hardware. Correlate reproducibility with application input, GPU identity, driver state and relevant system error records. A known-good workload on the same device and the reproducer on another qualified device can help narrow the explanation.&lt;/p&gt;

&lt;p&gt;Keep those comparisons controlled. Moving to another node often changes the GPU, driver, container environment and neighboring load at once. If the result changes, identify which variables differ before assigning the cause to a card.&lt;/p&gt;

&lt;p&gt;Where hardware health evidence warrants maintenance, preserve it and use the approved node-isolation process. Do not reset a GPU serving other jobs as an application-debugging shortcut.&lt;/p&gt;

&lt;h2 id=&quot;close-with-optimized-correctness-and-ordinary-execution&quot;&gt;Close with optimized correctness and ordinary execution&lt;/h2&gt;

&lt;p&gt;Retain the reproducer as a regression test with an expected result. Re-run the relevant sanitizer, then execute the optimized program through the normal scheduler and container path. Confirm numerical or structural output correctness, cleanup and the behavior of the original input.&lt;/p&gt;

&lt;p&gt;Measure performance again without the debugger or sanitizer. A fix that adds an accidental device-wide synchronization may be correct but carry a material cost. Explain that cost or replace the broad synchronization with the required dependency.&lt;/p&gt;

&lt;p&gt;For a device that is correct but slow, continue with &lt;a href=&quot;/writing/nsight-systems-compute-cache-core-analysis/&quot;&gt;Nsight timeline and kernel analysis&lt;/a&gt;. That investigation starts from a working result rather than trying to optimize corrupted computation.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Ansible patching: verify the running service after the package transaction</title>
    <link href="https://www.wirewalk.com/writing/ansible-linux-patching-canaries/"/>
    <published>2026-04-15T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/ansible-linux-patching-canaries/</id>
    <summary>Use small batches, explicit stop conditions, and application checks to avoid reporting installation as remediation.</summary>
    <content type="html">&lt;p&gt;A package manager can report a successful update while the vulnerable process keeps running. A required restart can also leave the application unhealthy. Include running-service checks and reboot requirements in the patch plan before rolling it across the inventory.&lt;/p&gt;

&lt;h2 id=&quot;define-the-change-boundary&quot;&gt;Define the change boundary&lt;/h2&gt;

&lt;p&gt;Identify the affected inventory, application owners, package source, reboot requirements, and rollback route. Separate hosts with different availability roles. A database replica, login node, and stateless worker should not share an unexamined reboot policy.&lt;/p&gt;

&lt;p&gt;Start with read-only inventory of installed packages, running kernels, and service health. Use vendor advisories for applicability rather than assuming that an upstream version string maps directly to a distribution’s security state.&lt;/p&gt;

&lt;h2 id=&quot;control-the-batch-size&quot;&gt;Control the batch size&lt;/h2&gt;

&lt;p&gt;Ansible documents &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;serial&lt;/code&gt; for batched execution in its &lt;a href=&quot;https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_strategies.html&quot;&gt;strategy guide&lt;/a&gt;. A skeleton for a reviewed playbook is:&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Validate a small Linux maintenance batch&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;hosts&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;maintenance_canary&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;serial&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;any_errors_fatal&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;tasks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Record the running kernel&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;ansible.builtin.command&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;uname -r&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;changed_when&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This example only records a kernel version; it deliberately does not install packages or reboot. Add application-specific prechecks, the approved update operation, restart handling, and postchecks through the normal change process.&lt;/p&gt;

&lt;h2 id=&quot;treat-check-mode-as-a-planning-aid&quot;&gt;Treat check mode as a planning aid&lt;/h2&gt;

&lt;p&gt;Ansible’s &lt;a href=&quot;https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_checkmode.html&quot;&gt;check-mode documentation&lt;/a&gt; describes module-dependent simulation. A clean check-mode run does not demonstrate a successful reboot, kernel-module compatibility, or a healthy application afterward.&lt;/p&gt;

&lt;p&gt;Run the full workflow on a representative canary. Include external client checks, not only service-manager status. A process can be active while its database connection or authentication path is broken.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-running-state&quot;&gt;Verify the running state&lt;/h2&gt;

&lt;p&gt;After maintenance, record the installed package version and the process or kernel actually in use. Confirm mounts, dependent services, application transactions, and monitoring. For hosts with specialized NIC, storage, or GPU modules, include compatibility checks appropriate to the deployed stack.&lt;/p&gt;

&lt;p&gt;If the canary fails, stop the rollout. Do not mark a host recovered merely because a second package command returned success. Use the established rollback or repair path and repeat the original service checks.&lt;/p&gt;

&lt;h2 id=&quot;account-for-incomplete-hosts&quot;&gt;Account for incomplete hosts&lt;/h2&gt;

&lt;p&gt;Report unreachable hosts, skipped tasks, deferred reboots, and accepted exceptions separately. An inventory of 200 targets with 190 successful transactions is not a fully patched fleet. Preserve the original target list so disappearing machines cannot improve the success percentage.&lt;/p&gt;

&lt;p&gt;For each target, record the change, the running-service check and any work still outstanding. Repeat the same acceptance checks after the next image rebuild so the patched state survives replacement as well as reboot.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>NFS nconnect: test connection parallelism without mistaking it for a storage upgrade</title>
    <link href="https://www.wirewalk.com/writing/nfs-nconnect-workload-validation/"/>
    <published>2026-04-09T10:00:00-04:00</published>
    <updated>2026-04-09T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nfs-nconnect-workload-validation/</id>
    <summary>Evaluate Linux NFS connection parallelism with controlled mount state, RPC evidence and application measurements, while preserving the workload’s durability and access requirements.</summary>
    <content type="html">&lt;p&gt;Increasing the number of NFS transport connections can help a client expose more useful parallelism. It cannot make a serial application issue concurrent requests, remove a server-side metadata bottleneck or turn one busy disk into a faster storage system.&lt;/p&gt;

&lt;p&gt;Treat &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nconnect&lt;/code&gt; as a client-path experiment. Establish what the workload is waiting for, compare supported connection counts under controlled mount conditions, and retain the configuration only if the measured benefit survives a realistic application test.&lt;/p&gt;

&lt;h2 id=&quot;identify-the-workload-before-choosing-a-mount-option&quot;&gt;Identify the workload before choosing a mount option&lt;/h2&gt;

&lt;p&gt;Separate large sequential reads, random small-file access, metadata discovery and checkpoint writes. They place different demands on NFS and may need different experiments. Record process count, outstanding I/O, file sizes and whether the application synchronizes writes.&lt;/p&gt;

&lt;p&gt;Measure the current service as an ordinary user. Root access can bypass an identity or permission problem that dominates the real workflow. Preserve the NFS version, transport, security flavor and mount options with the baseline.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://man7.org/linux/man-pages/man5/nfs.5.html&quot;&gt;Linux nfs manual&lt;/a&gt; documents connection-related options and their limits. Confirm support in the deployed distribution kernel and server combination. An option accepted by one client’s tooling is not a general support statement for every NFS implementation.&lt;/p&gt;

&lt;h2 id=&quot;keep-transport-parallelism-distinct-from-application-parallelism&quot;&gt;Keep transport parallelism distinct from application parallelism&lt;/h2&gt;

&lt;p&gt;More connections create additional transport paths between a client and server. The application still needs enough useful outstanding work to occupy them. A single synchronous operation followed by computation may leave extra connections mostly unused.&lt;/p&gt;

&lt;p&gt;NFS version, RPC behavior, server limits and the client’s existing transport state can affect the outcome. Do not equate a requested connection count with that many independently busy lanes. Inspect the effective mount and transport observations using tools supported by the installed client.&lt;/p&gt;

&lt;p&gt;Also distinguish connections from network interfaces. Multiple TCP connections do not by themselves establish multiple physical paths, balanced link utilization or server failover. Verify the routing and server architecture separately if those are part of the requirement.&lt;/p&gt;

&lt;h2 id=&quot;control-the-clients-starting-state&quot;&gt;Control the client’s starting state&lt;/h2&gt;

&lt;p&gt;Use a dedicated test client or an approved maintenance window. Record all related mounts to the server and consult the distribution’s guidance on transport sharing and option interactions. A remount or a second mount point should not be assumed to create a clean transport experiment.&lt;/p&gt;

&lt;p&gt;Do not unmount a filesystem under active research processes merely to reset a benchmark. Locate users of the mount, arrange a safe boundary and retain a rollback configuration. A spare client is often cheaper than trying to untangle a live client’s accumulated state.&lt;/p&gt;

&lt;p&gt;Useful read-only observations include:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;findmnt &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; nfs,nfs4 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; TARGET,SOURCE,FSTYPE,OPTIONS
nfsstat &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/self/mountstats
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Save the outputs with timestamps and use interval differences for cumulative statistics. The &lt;a href=&quot;https://man7.org/linux/man-pages/man8/nfsstat.8.html&quot;&gt;nfsstat reference&lt;/a&gt; explains the available client and mount views. These commands describe observed state; none proves that an application has enough concurrency to benefit.&lt;/p&gt;

&lt;h2 id=&quot;build-a-small-comparison-matrix&quot;&gt;Build a small comparison matrix&lt;/h2&gt;

&lt;p&gt;Test a modest set of supported connection counts rather than every possible number. Keep the server, export, dataset, client CPU placement and application concurrency fixed. Repeat selected runs in different orders to expose cache warming and background interference.&lt;/p&gt;

&lt;p&gt;Collect end-to-end application rate, CPU use, RPC latency, retransmission evidence and server-side load where available. Separate client execution delay, network delay and server service time according to what the installed statistics actually measure. A field name that sounds like latency may include waiting outside the server.&lt;/p&gt;

&lt;p&gt;For a hypothetical result, doubling connections may improve a multi-process sequential read but leave a directory scan unchanged. That supports using the option for the first workload if it remains stable. It does not justify a fleet-wide claim that NFS became twice as fast.&lt;/p&gt;

&lt;h2 id=&quot;preserve-correctness-related-mount-behavior&quot;&gt;Preserve correctness-related mount behavior&lt;/h2&gt;

&lt;p&gt;Change one connection-related variable at a time. Keep security, cache-consistency and error-handling semantics fixed unless the experiment specifically concerns them. Comparing a durability-preserving baseline with an unsafe shortcut confuses two different decisions.&lt;/p&gt;

&lt;p&gt;A filesystem used for research outputs must handle failures according to the application’s requirements. Do not choose a timeout or error-return policy merely because it makes a benchmark finish promptly during an outage. Review the documented semantics and validate the application’s response to partial or failed I/O.&lt;/p&gt;

&lt;p&gt;Include a write-and-readback test with meaningful integrity checks. If the workflow relies on a completion marker, verify the operations that make it visible and durable in the intended failure model. Connection parallelism does not replace that protocol.&lt;/p&gt;

&lt;h2 id=&quot;look-for-the-next-bottleneck&quot;&gt;Look for the next bottleneck&lt;/h2&gt;

&lt;p&gt;An improvement can move pressure elsewhere. More outstanding requests may increase server CPU use or lengthen another client’s latency. Test a neighboring workload and measure the server’s behavior before accepting the new setting for a shared environment.&lt;/p&gt;

&lt;p&gt;If the application remains slow, compare its timeline with the transport observations. High data throughput can coexist with slow startup caused by file discovery. Low wire utilization can result from CPU decoding or a serialized application loop. Those patterns call for different changes.&lt;/p&gt;

&lt;p&gt;For NVIDIA training jobs, measure samples or steps completed as well as NFS bytes. Faster storage reads do not guarantee that the GPU sees batches sooner if preprocessing remains the limiting stage.&lt;/p&gt;

&lt;h2 id=&quot;roll-out-the-measured-configuration&quot;&gt;Roll out the measured configuration&lt;/h2&gt;

&lt;p&gt;Keep the original mount definition and a tested way to restore it. Apply the selected setting to a small set of clients, observe ordinary jobs and check reconnect behavior during a planned service event where feasible.&lt;/p&gt;

&lt;p&gt;Record kernel and client-package versions with the result. Repeat qualification after changes that can affect the transport path. The useful outcome is a known client configuration for a defined workload, with an explanation of why it helps and where it does not.&lt;/p&gt;

&lt;p&gt;For a wider server-side investigation, see &lt;a href=&quot;/writing/powerscale-isilon-nfs-performance-troubleshooting/&quot;&gt;PowerScale NFS performance troubleshooting&lt;/a&gt;. Connection tuning belongs inside that larger workload and service picture.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Operating an NVIDIA AI platform: GPU Operator, DCGM, releases, and recovery</title>
    <link href="https://www.wirewalk.com/writing/production-ai-it-service-boundaries/"/>
    <published>2026-04-08T10:00:00-04:00</published>
    <updated>2026-04-08T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/production-ai-it-service-boundaries/</id>
    <summary>Operate NVIDIA AI infrastructure through controlled drivers and containers, GPU Operator boundaries, DCGM monitoring, scheduler allocation, Triton release management, and tested recovery.</summary>
    <content type="html">&lt;p&gt;Who gets the call when an AI endpoint returns a convincing but wrong answer? The model owner may need to investigate, but so may the teams running its drivers, GPU allocation, storage and data access. Define those responsibilities while building the NVIDIA platform, before the first production incident.&lt;/p&gt;

&lt;p&gt;Keep a tested platform configuration and a controlled model-release path. Connect each to the people responsible for identity, artifacts, capacity and acceptable application outputs.&lt;/p&gt;

&lt;h2 id=&quot;own-the-nvidia-node-software-lifecycle&quot;&gt;Own the NVIDIA node software lifecycle&lt;/h2&gt;

&lt;p&gt;For Kubernetes, NVIDIA GPU Operator is an option for managing components such as drivers, container integration, device plugins, node discovery, and monitoring. The &lt;a href=&quot;https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/24.3.0/index.html&quot;&gt;24.3 documentation&lt;/a&gt; also describes privileged operands. Keep administration of that namespace restricted; GPU access for an application does not require permission to replace the host driver.&lt;/p&gt;

&lt;p&gt;On a Slurm or other non-Kubernetes platform, manage those host components through the site’s image and configuration process. GPU Operator is not a universal cluster manager. In either case, record the kernel, driver, firmware where relevant, container runtime, and qualified application images.&lt;/p&gt;

&lt;p&gt;Canary a driver or runtime change on a drained node, then test representative training, inference, and communication before a wider rollout. Confirm how the previous node image or package set can be restored. Pinning a container digest cannot roll back an incompatible host-driver change.&lt;/p&gt;

&lt;h2 id=&quot;connect-device-health-to-service-and-scheduler-behavior&quot;&gt;Connect device health to service and scheduler behavior&lt;/h2&gt;

&lt;p&gt;Use DCGM-derived observations with host, fabric, scheduler, and application metrics. The &lt;a href=&quot;https://docs.nvidia.com/datacenter/dcgm/2.3/dcgm-user-guide/feature-overview.html&quot;&gt;DCGM 2.3 guide&lt;/a&gt; documents health and profiling functions available before this article’s date. Interpret fields using their definitions and hardware support; a busy GPU is not proof that requests meet their deadline.&lt;/p&gt;

&lt;p&gt;Preserve GPU identity and node identity in telemetry so that recurring device errors can be distinguished from a bad model release. Define a response to device faults: stop admitting work, drain or isolate the affected allocation, preserve logs, and run an appropriate maintenance diagnostic. Do not run disruptive stress diagnostics over production jobs merely because a monitoring tool offers them.&lt;/p&gt;

&lt;p&gt;For Triton serving, qualify the &lt;a href=&quot;https://raw.githubusercontent.com/triton-inference-server/server/r24.04/docs/user_guide/model_management.md&quot;&gt;24.04 model-management modes&lt;/a&gt; before selecting a repository update process. Version directories alone do not make a multi-component application update atomic. Promote a tested bundle and verify that the expected artifact is actually loaded on each replica.&lt;/p&gt;

&lt;p&gt;Capacity includes failure and maintenance. Reserve headroom for draining a node, loading a replacement model, and rebuilding a damaged replica. Then test the identity, data-boundary, admission, and rollback controls below through the external service interface. Infrastructure readiness and acceptable answer quality are separate gates that the production release must satisfy together.&lt;/p&gt;

&lt;h2 id=&quot;draw-the-service-and-data-boundaries&quot;&gt;Draw the service and data boundaries&lt;/h2&gt;

&lt;p&gt;List callers, entry points, retrieval sources, model runtimes, artifact stores, telemetry destinations, and external processors. Identify which trust boundary each request crosses and which identity is used at each hop.&lt;/p&gt;

&lt;p&gt;Separate the caller’s authority from the service account’s authority. A service that can read a broad document collection must still restrict retrieval to the documents the particular caller is allowed to use. Passing a user identifier into a prompt does not enforce that restriction.&lt;/p&gt;

&lt;p&gt;Document where prompts, retrieved text, outputs, and error traces are retained. Logs can contain the same confidential material as the original request. Choose retention and access deliberately, and test that debugging paths do not bypass the normal handling rules.&lt;/p&gt;

&lt;h2 id=&quot;use-distinct-identities-for-distinct-duties&quot;&gt;Use distinct identities for distinct duties&lt;/h2&gt;

&lt;p&gt;Give serving, training, artifact publication, and deployment separate identities when the platform supports it. A serving process needs to load approved artifacts and answer requests; it should not automatically have permission to replace the production model.&lt;/p&gt;

&lt;p&gt;Prefer short-lived credentials or platform identity mechanisms over embedded long-lived secrets. Define rotation and revocation behavior. Test what happens to an already running process when its access is revoked or a secret expires.&lt;/p&gt;

&lt;p&gt;Keep administrative access auditable. An emergency update should still leave a record of the actor, artifact, time, and reason. Otherwise an unexpected quality change becomes difficult to distinguish from an unauthorized deployment.&lt;/p&gt;

&lt;p&gt;These are operating recommendations. They should be implemented with the identity and authorization mechanisms of the chosen platform rather than assumed from the presence of an AI gateway.&lt;/p&gt;

&lt;h2 id=&quot;treat-model-loading-as-software-execution&quot;&gt;Treat model loading as software execution&lt;/h2&gt;

&lt;p&gt;Model releases can contain executable code, custom operators, serialized objects, and dependency requirements. Review the loading path and artifact origin. A filename ending in “weights” is not an integrity guarantee.&lt;/p&gt;

&lt;p&gt;Pin artifact revisions, preserve checksums, and limit who can publish to the location serving processes trust. Where available, use an appropriate signed-artifact or provenance workflow and verify it during promotion. A checksum detects a change only when the expected checksum comes from a trusted record.&lt;/p&gt;

&lt;p&gt;Build an inventory of runtime, tokenizer, preprocessing, model, and custom-code versions. The &lt;a href=&quot;https://scikit-learn.org/1.4/model_persistence.html&quot;&gt;scikit-learn 1.4 persistence guidance&lt;/a&gt; discusses risks and compatibility concerns for persisted models; apply the same scrutiny to the actual serialization and loading mechanism in your stack.&lt;/p&gt;

&lt;h2 id=&quot;set-input-limits-before-allocating-expensive-work&quot;&gt;Set input limits before allocating expensive work&lt;/h2&gt;

&lt;p&gt;Validate authentication, schema, supported types, document size, and resource limits before invoking the expensive path. For language models, bound both input and requested output. For other models, bound shapes, batch sizes, and decoded media dimensions.&lt;/p&gt;

&lt;p&gt;Use admission control that reflects the scarce resource. Request count alone may be inadequate when one request contains a short sentence and another contains a very long document. Queue work within a defined deadline and reject excess load with a response callers can handle.&lt;/p&gt;

&lt;p&gt;Define retry behavior. Unbounded retries can multiply pressure during an outage. Use bounded attempts, backoff, and a shared request identity where downstream effects need deduplication. A caller should know whether a timeout means no work occurred, work may still be running, or the result is available for retrieval.&lt;/p&gt;

&lt;h2 id=&quot;measure-availability-and-answer-quality-separately&quot;&gt;Measure availability and answer quality separately&lt;/h2&gt;

&lt;p&gt;Service metrics include request volume, latency distribution, queue age, rejection rate, timeouts, dependency failures, and capacity pressure. Model metrics include task quality, invalid outputs, unsupported assertions, calibration where applicable, and performance on important slices.&lt;/p&gt;

&lt;p&gt;An HTTP 200 response is not proof of a useful answer. Conversely, a quality dashboard based on mature labels cannot replace immediate monitoring of a failed server. Keep both views and connect them through model revision and request lineage.&lt;/p&gt;

&lt;p&gt;Choose log fields that support diagnosis without routinely storing full sensitive content. Capture a controlled sample for quality review only under an explicit handling policy. Preserve access to the inputs needed for authorized incident investigation when the retention requirements permit it.&lt;/p&gt;

&lt;h2 id=&quot;specify-dependency-failure-behavior&quot;&gt;Specify dependency failure behavior&lt;/h2&gt;

&lt;p&gt;What happens when retrieval is unavailable, a feature source is stale, or the external model service times out? Returning an unsupported answer may be worse than returning a clear temporary failure.&lt;/p&gt;

&lt;p&gt;Define fallback behavior per task. A cached result needs a freshness limit and the same authorization boundary as the original request. A smaller fallback model needs evaluation on the task. A manual review path needs real capacity and ownership.&lt;/p&gt;

&lt;p&gt;Test these conditions with isolated fixtures. Disable one dependency at a time and verify the externally visible behavior. Do not claim that a fallback works merely because a configuration key names it.&lt;/p&gt;

&lt;h2 id=&quot;promote-complete-releases-and-rehearse-rollback&quot;&gt;Promote complete releases and rehearse rollback&lt;/h2&gt;

&lt;p&gt;Promote an immutable bundle containing model artifacts, preprocessing, input and output contracts, runtime identifiers, thresholds or generation settings, and evaluation results. Stage it through a clean load test and an appropriate limited rollout.&lt;/p&gt;

&lt;p&gt;Tie observed behavior to the exact release identifier. During a partial rollout, aggregate metrics can hide which version caused a regression. Preserve routing evidence and compare like populations.&lt;/p&gt;

&lt;p&gt;Rollback should restore a compatible bundle, not just a weight file. Verify that the previous version still works with current callers, feature schemas, and retrieval configuration. Keep a tested route to the previous artifact and a way to stop new traffic if no version is acceptable.&lt;/p&gt;

&lt;h2 id=&quot;assign-ownership-for-incorrect-results&quot;&gt;Assign ownership for incorrect results&lt;/h2&gt;

&lt;p&gt;An on-call engineer can restart a service but may not be authorized to decide whether its answers are acceptable. Name the operational owner, model or evaluation owner, data owner, and business decision owner. Define who can suspend automation and who approves resumption.&lt;/p&gt;

&lt;p&gt;For an incident, preserve the release, affected request identifiers, dependency state, and evidence of downstream actions. If data access is involved, scope exposure through actual authorization and logging evidence. If quality is involved, identify the affected input population rather than assuming every response was wrong.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://arxiv.org/abs/2209.09125&quot;&gt;2022 study of operationalizing ML&lt;/a&gt; describes recurring work across data collection, experimentation, evaluation, and monitoring. The service controls proposed here connect those responsibilities to ordinary production operations.&lt;/p&gt;

&lt;p&gt;For a reported bad result, the on-call team should be able to find the request, identify the release and contain further harm. Rehearse that investigation along with deployment and rollback.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>NVIDIA MIG with Slurm: make GPU profiles a reliable scheduling contract</title>
    <link href="https://www.wirewalk.com/writing/nvidia-mig-slurm-profile-admission/"/>
    <published>2026-03-30T10:00:00-04:00</published>
    <updated>2026-03-30T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nvidia-mig-slurm-profile-admission/</id>
    <summary>Qualify fixed MIG layouts, device isolation, profile naming and accounting before offering GPU slices to research users through Slurm.</summary>
    <content type="html">&lt;p&gt;A small GPU job may need only a fraction of a large accelerator’s memory and compute capacity. NVIDIA Multi-Instance GPU can make that capacity useful to more researchers, but only if the scheduler’s description matches the instances that exist on the node.&lt;/p&gt;

&lt;p&gt;The difficult part is maintaining that agreement across boot, driver changes and container launches. Treat a MIG layout as a qualified node configuration. A user asking for one GPU slice should receive a known resource, not whichever profile happened to be left by the previous maintenance session.&lt;/p&gt;

&lt;p&gt;This discussion focuses on established A100 and H100-era MIG operation. Profiles, enumeration and communication capabilities vary with GPU generation and driver release; do not transfer one platform’s behavior to another without testing it.&lt;/p&gt;

&lt;h2 id=&quot;start-from-the-workloads-memory-requirement&quot;&gt;Start from the workload’s memory requirement&lt;/h2&gt;

&lt;p&gt;Measure peak device memory for a representative run, including initialization, evaluation and checkpoint operations. A model that fits during steady-state training may fail when evaluation uses a different batch or an optimizer allocates additional state.&lt;/p&gt;

&lt;p&gt;Choose profile candidates from the supported combinations on the actual GPU. Profile names are not interchangeable between devices with different memory capacities. Preserve the NVIDIA-reported name, driver version and instance inventory in the qualification record.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.nvidia.com/datacenter/tesla/mig-user-guide/deployment-considerations.html&quot;&gt;NVIDIA’s MIG deployment guide&lt;/a&gt; describes platform-dependent mode and reset considerations. Establish whether the mode and configured instances survive the lifecycle events your site uses. A reboot test matters even if the previous node seemed persistent.&lt;/p&gt;

&lt;h2 id=&quot;keep-partitioning-outside-ordinary-job-startup&quot;&gt;Keep partitioning outside ordinary job startup&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://slurm.schedmd.com/gres.html&quot;&gt;Slurm GRES guide&lt;/a&gt; describes treating preconfigured MIG instances as GPU resources. Its MIG support expects the instances to exist; the ordinary scheduling mechanism is not a dynamic partition planner.&lt;/p&gt;

&lt;p&gt;Drain a node before changing a qualified layout. Stop affected clients through the supported maintenance process, configure the intended profiles, then reconcile the inventory with Slurm before admitting jobs. Running a profile-changing command in a user’s prolog creates races between jobs and makes failure recovery harder to explain.&lt;/p&gt;

&lt;p&gt;Maintain explicit node classes if the service offers different layouts. A whole-GPU training node and a node serving smaller independent workloads have different admission tests. Keeping a few stable classes is often easier to operate than promising arbitrary combinations for every submission.&lt;/p&gt;

&lt;h2 id=&quot;validate-discovery-before-writing-resource-names&quot;&gt;Validate discovery before writing resource names&lt;/h2&gt;

&lt;p&gt;Read the device inventory on the node:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvidia-smi &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;
nvidia-smi &lt;span class=&quot;nt&quot;&gt;--query-gpu&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;name,uuid,driver_version &lt;span class=&quot;nt&quot;&gt;--format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;csv
slurmd &lt;span class=&quot;nt&quot;&gt;-G&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;slurmd -G&lt;/code&gt; in the configured node environment with the permissions appropriate to the site; it tests and prints GRES information rather than proving an allocation can use it. Review its diagnostics, including ignored devices and mismatches.&lt;/p&gt;

&lt;p&gt;Use the supported NVML-based discovery and profile-type rules for the installed Slurm version. Do not invent a friendly type string and assume discovery will match it. Confirm what users should request, what &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scontrol show node&lt;/code&gt; advertises and which profile a real task receives.&lt;/p&gt;

&lt;h2 id=&quot;test-isolation-through-the-launch-path&quot;&gt;Test isolation through the launch path&lt;/h2&gt;

&lt;p&gt;Run two allocations concurrently on separate instances. In each, record visible devices and execute a small workload that allocates and uses the assigned GPU memory. Confirm that one job cannot open the other’s device through the access paths available to an ordinary user.&lt;/p&gt;

&lt;p&gt;Repeat inside the supported container runtime. Environment variables that restrict visibility are not a substitute for device-access enforcement. The scheduler, cgroups, NVIDIA capability devices and runtime integration must agree on the resource boundary.&lt;/p&gt;

&lt;p&gt;Ask for more memory than the profile provides in an intentionally bounded test. The expected result is a contained application failure, with the neighboring allocation still operating correctly. This is a useful negative test; it is not a recommendation to stress production users’ instances.&lt;/p&gt;

&lt;h2 id=&quot;keep-accounting-limitations-visible&quot;&gt;Keep accounting limitations visible&lt;/h2&gt;

&lt;p&gt;An allocation record and a utilization measurement answer different questions. Slurm documents limitations in GPU utilization and memory accounting for MIG through its NVML path. Do not turn missing per-instance measurements into zeros or conclude that a scheduled instance was idle.&lt;/p&gt;

&lt;p&gt;Design dashboards around what the installed monitoring stack actually supports. Record stable parent-GPU identity as well as the current instance identity. Recreating instances can change identifiers; joining historical measurements by a transient index alone can assign yesterday’s workload to today’s instance.&lt;/p&gt;

&lt;p&gt;Use application completion and elapsed time to evaluate whether the service helps users. A high count of allocated slices is not sufficient evidence of useful throughput, especially if profiles are too small and jobs repeatedly fail or reduce batch size excessively.&lt;/p&gt;

&lt;h2 id=&quot;test-the-research-workflow-including-its-limits&quot;&gt;Test the research workflow, including its limits&lt;/h2&gt;

&lt;p&gt;A single-device notebook, independent inference jobs and tightly coupled multi-GPU training impose different requirements. Validate the exact CUDA, framework and communication-library combination for the intended workload. MIG’s supported communication behavior has changed across software and hardware generations, so a blanket promise about peer access or collective support is inappropriate.&lt;/p&gt;

&lt;p&gt;Include restart, checkpoint load and ordinary job cleanup in the acceptance test. After an allocation ends, confirm that its processes are gone and the next user receives a clean resource. Where site policy requires additional isolation, assess that policy independently of the profile’s capacity partitioning.&lt;/p&gt;

&lt;p&gt;Finally, reboot the drained canary and repeat discovery and one real allocation. Save the successful layout, manifests and scheduler configuration as a release unit. That turns MIG from a one-time partitioning exercise into a service whose behavior researchers can plan around.&lt;/p&gt;

&lt;p&gt;For whole-node enforcement checks, see &lt;a href=&quot;/writing/slurm-cgroup-v2-gpu-isolation-validation/&quot;&gt;Slurm CPU, memory and GPU isolation&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SELinux denials: repair the application boundary before generating policy</title>
    <link href="https://www.wirewalk.com/writing/selinux-denials-without-disabling/"/>
    <published>2026-03-22T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/selinux-denials-without-disabling/</id>
    <summary>Labels, supported booleans, and application behavior should be understood before a new allow rule is introduced.</summary>
    <content type="html">&lt;p&gt;When an application fails under SELinux, capture the denial before changing enforcement. A mislabeled directory, a supported service setting and an operation the service should never perform need different fixes.&lt;/p&gt;

&lt;h2 id=&quot;capture-the-actual-denial&quot;&gt;Capture the actual denial&lt;/h2&gt;

&lt;p&gt;On a RHEL-family host with SELinux and audit tools installed, begin with read-only inspection:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;getenforce
sestatus
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;ausearch &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; AVC,USER_AVC &lt;span class=&quot;nt&quot;&gt;-ts&lt;/span&gt; recent
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Zd&lt;/span&gt; /srv /srv/example-app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The paths are examples. Use the real application path, and preserve timestamps so the denial can be connected to the failed transaction. Absence of an AVC does not prove SELinux is unrelated; inspect the logging state and relevant troubleshooting guidance.&lt;/p&gt;

&lt;p&gt;Use the distribution’s supported policy and tools. The &lt;a href=&quot;https://github.com/SELinuxProject/selinux&quot;&gt;SELinux project&lt;/a&gt; maintains the userspace tools, while the &lt;a href=&quot;https://docs.kernel.org/admin-guide/LSM/SELinux.html&quot;&gt;kernel documentation&lt;/a&gt; points to the subsystem and policy resources.&lt;/p&gt;

&lt;h2 id=&quot;identify-the-boundary-being-crossed&quot;&gt;Identify the boundary being crossed&lt;/h2&gt;

&lt;p&gt;Read the source context, target context, object class, and denied permission. Connect those to the application operation. Is a web process trying to read its content, write an upload directory, contact a database, or access something unrelated?&lt;/p&gt;

&lt;p&gt;Check file labeling against the intended path policy. For an approved path, a nonmodifying preview can help:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;restorecon &lt;span class=&quot;nt&quot;&gt;-nRv&lt;/span&gt; /srv/example-app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-n&lt;/code&gt; preview reports prospective relabeling rather than applying it. A correct custom path may need a persistent file-context definition before any relabel operation; repeatedly applying a temporary label is not a durable deployment method.&lt;/p&gt;

&lt;h2 id=&quot;prefer-a-narrow-explanation&quot;&gt;Prefer a narrow explanation&lt;/h2&gt;

&lt;p&gt;If the distribution provides a documented boolean for the intended behavior, review its scope before enabling it. If the service was configured to write into a read-only content path, correcting the application layout may be the better fix.&lt;/p&gt;

&lt;p&gt;Do not feed a large collection of historical denials into an automatic policy generator and install the result without review. That can authorize unrelated activity and preserve a misconfiguration as policy.&lt;/p&gt;

&lt;h2 id=&quot;validate-the-change-in-a-pilot&quot;&gt;Validate the change in a pilot&lt;/h2&gt;

&lt;p&gt;Apply the approved label, configuration, or minimal policy change to a lab or pilot system. Run the previously failing transaction in enforcing mode. Then run an operation that should remain denied. Successful application behavior alone does not prove the boundary stayed narrow.&lt;/p&gt;

&lt;p&gt;Reboot or redeploy the pilot where appropriate to confirm the fix survives normal lifecycle operations. A label repair that disappears at the next image rollout is incomplete.&lt;/p&gt;

&lt;h2 id=&quot;retain-the-reason&quot;&gt;Retain the reason&lt;/h2&gt;

&lt;p&gt;Keep the denial, diagnosis, exact change, positive test, and negative test. Document any exception with its owner and review date. The record should explain why the exception or label change was necessary, so it can be reviewed when the service or image changes.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Slurm job arrays: choose concurrency by completed work and filesystem pressure</title>
    <link href="https://www.wirewalk.com/writing/slurm-job-arrays-metadata-concurrency/"/>
    <published>2026-03-18T10:00:00-04:00</published>
    <updated>2026-03-18T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/slurm-job-arrays-metadata-concurrency/</id>
    <summary>Control array concurrency, input discovery and result publication so large parameter sweeps finish predictably without overwhelming shared metadata services.</summary>
    <content type="html">&lt;p&gt;A parameter sweep can run thousands of tasks and still finish more slowly after its concurrency limit is raised. The tasks may spend their additional time opening files, importing the same environment or waiting for a metadata service that every worker reaches at once.&lt;/p&gt;

&lt;p&gt;Arrays simplify submission and identification. They do not remove the cost of starting processes or accessing shared storage. The practical unit to optimize is a completed input with a valid output, including the time spent recovering failures.&lt;/p&gt;

&lt;h2 id=&quot;make-the-task-index-refer-to-a-stable-input&quot;&gt;Make the task index refer to a stable input&lt;/h2&gt;

&lt;p&gt;Create an input manifest before submission. Give each work item a durable identifier and preserve the exact manifest with the run. Sorting a directory independently inside each task is unsafe when files can be added or renamed while the array runs.&lt;/p&gt;

&lt;p&gt;For a modest manifest, a line-number lookup can be enough. For a very large one, repeatedly scanning from the start becomes wasteful; use a precomputed index or a representation that supports direct access. Avoid putting executable shell fragments in the manifest. Treat parameters as data and pass them as separate arguments.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://slurm.schedmd.com/job_array.html&quot;&gt;Schematic array submission&lt;/a&gt; can use a concurrency limit:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --array=0-999%24&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --cpus-per-task=1&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --mem=2G&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --time=00:20:00&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --output=logs/%A_%a.out&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-euo&lt;/span&gt; pipefail
python worker.py &lt;span class=&quot;nt&quot;&gt;--manifest&lt;/span&gt; inputs.jsonl &lt;span class=&quot;nt&quot;&gt;--index&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SLURM_ARRAY_TASK_ID&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here, 1,000 tasks and a limit of 24 are illustrative choices, not recommended defaults. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;logs&lt;/code&gt; directory must exist before the job starts. The worker must validate that its index resolves to one intended record and write an output associated with that record.&lt;/p&gt;

&lt;h2 id=&quot;measure-what-happens-before-computation&quot;&gt;Measure what happens before computation&lt;/h2&gt;

&lt;p&gt;Break task duration into environment setup, input discovery, data reads, computation and publication. A task that computes for two seconds after importing packages for twenty deserves a different execution design from a simulation that runs for two hours.&lt;/p&gt;

&lt;p&gt;Collect a few representative task timelines instead of tracing every filesystem operation from every worker at once. Diagnostic logging can itself overload the service under investigation. Record enough timestamps to identify whether the delay is at startup, steady state or shutdown.&lt;/p&gt;

&lt;p&gt;Check the directory layout. A large array creating several files per task in one shared directory can turn publication into a queue of metadata operations. Shard output directories by a stable work-item key when appropriate. A directory per task can also become expensive, so measure the total object count rather than assuming more directories solve everything.&lt;/p&gt;

&lt;h2 id=&quot;sweep-concurrency-over-complete-runs&quot;&gt;Sweep concurrency over complete runs&lt;/h2&gt;

&lt;p&gt;Hold input, environment and resource requests constant. Compare several bounded concurrency settings. Measure accepted outputs per minute, elapsed completion time, failure rate and storage-side latency where available. Watch impact on other users as well as the array itself.&lt;/p&gt;

&lt;p&gt;A hypothetical test might find 12 tasks complete 30 items per minute, 24 complete 49, and 48 complete 45 while metadata latency rises. That supports investigating the 24-task region; it does not establish a universal optimum or prove that storage is the only constraint.&lt;/p&gt;

&lt;p&gt;Use enough work to get past cache warming and stagger effects. Repeat selected points and retain the distributions. A single fast run after a slow run can simply be the second run benefiting from already-read inputs.&lt;/p&gt;

&lt;h2 id=&quot;batch-tiny-work-without-hiding-failures&quot;&gt;Batch tiny work without hiding failures&lt;/h2&gt;

&lt;p&gt;If startup dominates, process a bounded group of inputs within one task. Keep resource requests and wall time honest. The task should record completion for each item so an interruption does not force the whole group to be treated as lost.&lt;/p&gt;

&lt;p&gt;There is a trade-off: larger groups amortize startup but make scheduling less flexible and increase the work affected by a failed attempt. Use measured item-duration variation to choose the group size. A fixed count can be a poor fit when one item takes a hundred times longer than another.&lt;/p&gt;

&lt;p&gt;Do not have each task repeatedly query the scheduler to decide whether it may continue. The array’s concurrency control already provides a useful bound. If another shared resource needs admission control, implement that at an appropriate service boundary rather than flooding the controller with polling.&lt;/p&gt;

&lt;h2 id=&quot;publish-results-that-retries-can-recognize&quot;&gt;Publish results that retries can recognize&lt;/h2&gt;

&lt;p&gt;Use a unique temporary destination for an attempt, validate the result, and publish it under the work item’s stable identifier. A file’s existence is not a completion test. Check its expected structure, input identity and relevant version information.&lt;/p&gt;

&lt;p&gt;Retries should distinguish a valid existing result from a partial one. Decide how concurrent attempts are prevented or reconciled; a blind overwrite can replace a successful result with a failed attempt’s output. For shared POSIX storage, review the atomicity and durability properties of the chosen publication operation.&lt;/p&gt;

&lt;p&gt;Keep failure categories separate. Input validation errors need correction, not more attempts. Transient service errors may deserve bounded retry. An out-of-memory task needs investigation of its actual resource demand before being sent through the same limit again.&lt;/p&gt;

&lt;h2 id=&quot;close-the-run-with-reconciliation&quot;&gt;Close the run with reconciliation&lt;/h2&gt;

&lt;p&gt;Compare the manifest with validated outputs. Account for every intended work item as completed, failed with an explanation or deliberately excluded. Scheduler success is useful execution evidence, but it does not establish that the worker processed the correct item or produced scientifically usable data.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://slurm.schedmd.com/sbatch.html&quot;&gt;sbatch reference&lt;/a&gt; documents array syntax and filename substitutions. Keep those mechanics separate from the application’s completion rules. Once the result ledger is reliable, selective retries become straightforward and a large sweep stops depending on someone visually inspecting thousands of log files.&lt;/p&gt;

&lt;p&gt;For wider data-processing bottlenecks, see &lt;a href=&quot;/writing/parallel-data-analysis-skew-shuffle/&quot;&gt;parallel analysis, skew and shuffle&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Four ways a storage benchmark lies and how to catch each one</title>
    <link href="https://www.wirewalk.com/writing/benchmarks-that-lie/"/>
    <published>2026-03-18T10:00:00-04:00</published>
    <updated>2026-03-18T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/benchmarks-that-lie/</id>
    <summary>A read test smaller than the server&apos;s buffer pool measures memory. An under-driven benchmark is indistinguishable from a ceiling. Counters are not rates, and aggregate CPU idle is meaningless on a many-core box. Here is the arithmetic that catches each one before you act on the number.</summary>
    <content type="html">&lt;p&gt;Storage benchmarks are unusually good at producing wrong answers that look
right. The number comes out, it is in the units you expected, it is in the
neighbourhood you hoped for, and nothing in the output says “this measurement
did not test what you think it tested”. Then someone writes it in a capacity
plan, or opens a support case about it, or spends a maintenance window tuning a
subsystem that was never the constraint.&lt;/p&gt;

&lt;p&gt;The four cases below have recognizable numerical signatures. A few minutes spent checking the arithmetic can save a much longer investigation of the wrong subsystem.&lt;/p&gt;

&lt;p&gt;The worked figures throughout are from one eight-server erasure-coded tier on
HDR200, and they are illustrative rather than a specification for anything: page
pool sizes, code widths and link rates all move the numbers. The arithmetic is
the part that transfers. Run it against your own configuration before quoting
any figure here.&lt;/p&gt;

&lt;h2 id=&quot;1-the-read-you-measured-was-served-from-memory&quot;&gt;1. The read you measured was served from memory&lt;/h2&gt;

&lt;p&gt;Most benchmarking guides tell you to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O_DIRECT&lt;/code&gt;. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fio --direct=1&lt;/code&gt;,
IOR’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--posix.odirect&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dd iflag=direct&lt;/code&gt; for a read or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;oflag=direct&lt;/code&gt; for a
write. This is correct advice and it is routinely misunderstood, because
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O_DIRECT&lt;/code&gt; is a flag on a file descriptor on one machine. It bypasses the page
cache on the client that opened the file. It has no authority whatsoever over
what the storage servers do with their own memory.&lt;/p&gt;

&lt;p&gt;On a parallel filesystem the servers hold a large read buffer. For IBM Storage
Scale in its erasure-coded form, that buffer is a percentage of the daemon’s
page pool, set by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsdRAIDBufferPoolSizePct&lt;/code&gt;. The documented default has been
50 percent historically and 80 percent in more recent releases, so read it
rather than assume it. The upper bound on the cache your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O_DIRECT&lt;/code&gt; read is
still landing in is:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;server-side buffer pool = pagepool × nsdRAIDBufferPoolSizePct × number of servers
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is an upper bound rather than a read cache exactly: the same pool holds
write and track buffers. It is still the right number to size a dataset
against, because it is the largest thing your read can hide in.&lt;/p&gt;

&lt;p&gt;Check yours rather than assuming. Note that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmlsconfig&lt;/code&gt; tells you what is
stored and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmfsadm dump config&lt;/code&gt; tells you what is actually running, and these
are not always the same value. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmfsadm&lt;/code&gt; is a diagnostic tool that IBM
documents as being for use under service direction; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dump config&lt;/code&gt; is read-only,
but treat the rest of the command surface as off-limits on a production
daemon:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mmlsconfig pagepool
mmlsconfig nsdRAIDBufferPoolSizePct
&lt;span class=&quot;c&quot;&gt;# and on one storage server, what is genuinely live:&lt;/span&gt;
mmfsadm dump config | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-iE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;pagepool|nsdRAIDBufferPoolSizePct&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Take a tier of eight storage servers with a 37.7 GiB page pool each and the
buffer pool at 80 percent. That is 30.2 GiB per server and 241 GiB across the
tier. Any read test whose working set is comfortably below 241 GiB is measuring
DDR, not NVMe, no matter how many &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O_DIRECT&lt;/code&gt; flags are in the command line.&lt;/p&gt;

&lt;p&gt;Here is what that looks like. Twelve clients, sixteen ranks each, 1 GiB per
rank — 192 GiB of data, which is 80 percent of the buffer pool:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 192 &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; 16 ./ior &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; POSIX &lt;span class=&quot;nt&quot;&gt;--posix&lt;/span&gt;.odirect &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; 1g &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; 1m &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; 1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /gpfs/scratch/bench/ior.dat
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;access    bw(MiB/s)  IOPS       Latency(s)  block(KiB) xfer(KiB)  open(s)   wr/rd(s)  close(s)  total(s)
------    ---------  ----       ----------  ---------- ---------  --------  --------  --------  --------
write     68812      68812      0.002790    1048576    1024.00    0.021443  2.857     0.003120  2.882
read      159539     159539     0.001203    1048576    1024.00    0.004472  1.232     0.001196  1.238
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;159,539 MiB/s is 155.8 GiB/s. It is also nonsense. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IOPS&lt;/code&gt; column equals the
bandwidth figure here only because the transfer size is exactly 1 MiB — IOR
reports completed transfers per second, not GiB/s, and at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-t 4m&lt;/code&gt; the two
columns would differ by four. Now the same test with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-b 16g&lt;/code&gt; — 3 TiB, nearly
thirteen times the buffer pool:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;access    bw(MiB/s)  IOPS       Latency(s)  block(KiB) xfer(KiB)  open(s)   wr/rd(s)  close(s)  total(s)
------    ---------  ----       ----------  ---------- ---------  --------  --------  --------  --------
write     68240      68240      0.002814    16777216   1024.00    0.019987  46.10     0.004011  46.13
read      83942      83942      0.002287    16777216   1024.00    0.003991  37.47     0.001330  37.48
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Read falls from 155.8 to 82.0 GiB/s. The first figure was 1.9 times the cold
number. Write barely moves — 68,812 to 68,240 MiB/s, or 67.2 to 66.6 GiB/s —
which is the part that tells you the
mechanism rather than just the magnitude: writes were never being served out of
a read buffer, so they had nothing to lose.&lt;/p&gt;

&lt;p&gt;Two tells you can spot without doing the arithmetic:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The read phase finished in a second.&lt;/strong&gt; Any storage read phase that completes
in under roughly ten seconds has measured startup transients and cache. IOR
prints &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;total(s)&lt;/code&gt; for exactly this reason. A 1.2 second read phase is not a
measurement, it is a rounding error with units.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read is more than twice write on hardware where it should not be.&lt;/strong&gt; Some
asymmetry is normal. A factor of 2.3 on a tier whose read and write paths use
the same NICs deserves an explanation before it gets published.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Here the obvious interpretation is wrong in a way worth stating plainly. When
the number falls after you enlarge the dataset, the natural conclusion is “so it
was cache, and 82 is the truth”. That conclusion is probably right, but two
points do not yet support it. Enlarging the dataset also lengthens the runtime,
changes which regions of the address space you touch, and may cross a storage
pool or fileset boundary with different placement. Any of those could depress
the number on its own.&lt;/p&gt;

  &lt;p&gt;The discriminator is more points along the same axis. Run at 2×, 4× and 8× the
buffer pool as well as the 12.7× above. A cache artefact produces a sharp fall
and then a flat floor — for instance 155.8 at 0.8×, then 82.4, 81.6, 82.3, 82.0
as the multiple climbs. A layout or locality effect produces a continuing slide.
If it keeps falling, you have found a second problem and you still do not know
the cold number.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;There is no supported command that flushes the server-side pool on demand, so
sizing the dataset past it is the practical answer. On the clients,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;echo 3 &amp;gt; /proc/sys/vm/drop_caches&lt;/code&gt; clears the Linux page cache but does not
touch the GPFS page pool, which is separate memory the daemon manages itself;
unmounting the filesystem on that client is what invalidates its cached buffers.&lt;/p&gt;

&lt;h2 id=&quot;2-an-under-driven-benchmark-is-indistinguishable-from-a-ceiling&quot;&gt;2. An under-driven benchmark is indistinguishable from a ceiling&lt;/h2&gt;

&lt;p&gt;This is the most expensive of the four, because it does not merely give you a
wrong number. It gives you a wrong number with a confident shape. You run at one
concurrency level, get 44 GiB/s, run again and get 44 GiB/s, add a node and get
44 GiB/s, and conclude you have found a hard wall. Everything about the result
says saturation. What you have actually found is that you did not ask for
enough work at once.&lt;/p&gt;

&lt;p&gt;The arithmetic is Little’s law. The number of I/Os that must be outstanding to
sustain a given bandwidth is:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;outstanding = bandwidth ÷ I/O size × latency
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;At 82 GiB/s with 1 MiB transfers, that is 88.0 GB/s ÷ 1,048,576 B = about
84,000 IOPS. If per-I/O latency at the knee is 18 ms, you need roughly 1,510
requests in flight across the whole client set to get there. If your benchmark
has 384 outstanding, then at that latency you are arithmetically incapable of
reaching the number, and no amount of repeating the run will reveal that.&lt;/p&gt;

&lt;p&gt;So sweep concurrency. Twelve clients, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iodepth=32&lt;/code&gt;, varying &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;numjobs&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;j &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;1 2 4 8 16&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;pdsh &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; node[01-12] &lt;span class=&quot;s2&quot;&gt;&quot;fio --name=r --filename=/gpfs/scratch/bench/&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(hostname)/f &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
    --rw=read --bs=1m --direct=1 --ioengine=libaio &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
    --iodepth=32 --numjobs=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$j&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; --size=256g --runtime=60 --time_based &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
    --group_reporting --output-format=json &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
    --output=/gpfs/scratch/bench/&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(hostname)/sweep-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$j&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.json&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Write each node’s JSON to its own file rather than redirecting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pdsh&lt;/code&gt; to one.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pdsh&lt;/code&gt; interleaves and line-prefixes the output of all twelve nodes, so a single
redirect gives you twelve mangled JSON documents in one file and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jq&lt;/code&gt; will
refuse it. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--direct=1&lt;/code&gt; is not optional here either: fio documents &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libaio&lt;/code&gt; as
only supporting queued behavior with non-buffered I/O, so on a buffered job it
degrades toward serialized submission and reintroduces exactly the
under-driving this sweep exists to detect.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--size=256g&lt;/code&gt; is chosen against problem 1, not at random. With &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--time_based&lt;/code&gt;
the 60-second run reads about 408 GiB from a 256 GiB file, so each node does
re-read its own data — but twelve nodes hold 3 TiB between them against a
241 GiB server pool, which keeps the hit rate low enough not to distort the
shape of the sweep. Shrink the file to something a single server could hold and
the whole curve lifts and flattens, and you will read the artefact as a ceiling.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;numjobs&lt;/code&gt; per node&lt;/th&gt;
      &lt;th&gt;Outstanding I/Os, all clients&lt;/th&gt;
      &lt;th&gt;Aggregate read (GiB/s)&lt;/th&gt;
      &lt;th&gt;Δ from previous&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;384&lt;/td&gt;
      &lt;td&gt;44.0&lt;/td&gt;
      &lt;td&gt;—&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;2&lt;/td&gt;
      &lt;td&gt;768&lt;/td&gt;
      &lt;td&gt;68.1&lt;/td&gt;
      &lt;td&gt;+55%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;4&lt;/td&gt;
      &lt;td&gt;1,536&lt;/td&gt;
      &lt;td&gt;81.5&lt;/td&gt;
      &lt;td&gt;+20%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;3,072&lt;/td&gt;
      &lt;td&gt;82.0&lt;/td&gt;
      &lt;td&gt;+0.6%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;16&lt;/td&gt;
      &lt;td&gt;6,144&lt;/td&gt;
      &lt;td&gt;81.7&lt;/td&gt;
      &lt;td&gt;−0.4%&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The shape is the result, not any single row. It climbs steeply, the climb
decays, and then three consecutive points agree within one percent while
concurrency quadruples. That flat tail is what licenses the sentence “this tier
saturates at 82 GiB/s”. Without it you have a lower bound and nothing more.&lt;/p&gt;

&lt;p&gt;Cross-check the knee against Little’s law. Here is the per-node fio output at
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;numjobs=4&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;read: IOPS=6955, BW=6955MiB/s (7292MB/s)(408GiB/60001msec)
    slat (usec): min=12, max=1843, avg=41.28, stdev=22.17
    clat (msec): min=2, max=118, avg=17.94, stdev=9.61
     lat (msec): min=2, max=118, avg=17.98, stdev=9.61
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;128 outstanding per node divided by 17.98 ms is 7,120 IOPS. fio reports 6,955,
and twelve nodes at that rate is 81.5 GiB/s, the table’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;numjobs=4&lt;/code&gt; row. The
two agree to within about two and a half percent, which means the queue was
genuinely full and the latency figure is describing the same system the
bandwidth figure is. When those two disagree badly — Little’s law predicting
double what fio reports, say — the queue was not full and one of the figures is
measuring something else.&lt;/p&gt;

&lt;p&gt;There is a second sweep people skip, and it answers a different question. Sweep
node count at fixed per-node concurrency:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;If one node and twelve nodes each get the same rate, you found a &lt;strong&gt;per-node&lt;/strong&gt;
limit — a NIC, a PCIe link, a single-threaded path.&lt;/li&gt;
  &lt;li&gt;If one node gets the whole budget and twelve nodes divide it, you found an
&lt;strong&gt;aggregate&lt;/strong&gt; limit — the servers, the disks, or the fabric between them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are different problems with different fixes, and a single-point
measurement cannot tell them apart.&lt;/p&gt;

&lt;h3 id=&quot;the-fio-trap-that-silently-caps-you-at-one&quot;&gt;The fio trap that silently caps you at one&lt;/h3&gt;

&lt;p&gt;Setting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iodepth=64&lt;/code&gt; with a synchronous I/O engine does nothing. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sync&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;psync&lt;/code&gt;
and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pvsync&lt;/code&gt; submit one request and wait for it; fio documents that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iodepth&lt;/code&gt;
beyond 1 has no effect for them. A job file with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ioengine=psync&lt;/code&gt; and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iodepth=64&lt;/code&gt; produces exactly the flat, confident, badly under-driven number
described above, and the command line looks like it asked for depth.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;^(ioengine|iodepth|numjobs)&apos;&lt;/span&gt; bench.fio
&lt;span class=&quot;c&quot;&gt;# ioengine=psync      &amp;lt;-- iodepth below is inert&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iodepth=64&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# numjobs=8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With a synchronous engine, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;numjobs&lt;/code&gt; is your only source of concurrency. With
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libaio&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;io_uring&lt;/code&gt;, total outstanding is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;numjobs × iodepth&lt;/code&gt; per node.&lt;/p&gt;

&lt;h2 id=&quot;3-a-counter-is-not-a-rate&quot;&gt;3. A counter is not a rate&lt;/h2&gt;

&lt;p&gt;This is among the most common measurement errors in the field and it is entirely
mechanical. Almost every hardware and driver statistic is cumulative since boot,
since daemon start, or since the last reset. Reading it once and dividing by the
duration of your benchmark produces a number with the right units and no
meaning.&lt;/p&gt;

&lt;p&gt;The tell is distinctive: the reported rate &lt;strong&gt;falls as you run the test longer&lt;/strong&gt;,
because the numerator is fixed history and the denominator is your runtime. If
changing only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--runtime&lt;/code&gt; changes your answer, you divided a counter by elapsed
time.&lt;/p&gt;

&lt;p&gt;The fix is to sample twice and difference. InfiniBand port counters, using the
extended 64-bit set so they do not wrap mid-run:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;lid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;37&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;12&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;interval&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;30
&lt;span class=&quot;nv&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;perfquery &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$lid&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$port&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt;: &lt;span class=&quot;s1&quot;&gt;&apos;/^PortXmitData/{gsub(/[^0-9]/,&quot;&quot;,$2); print $2}&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$interval&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;perfquery &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$lid&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$port&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt;: &lt;span class=&quot;s1&quot;&gt;&apos;/^PortXmitData/{gsub(/[^0-9]/,&quot;&quot;,$2); print $2}&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$interval&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&apos;BEGIN{printf &quot;%.2f GiB/s\n&quot;, (b-a)*4/t/1073741824}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;23.14 GiB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two details in that snippet are easy to get wrong. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitData&lt;/code&gt; is defined in
the InfiniBand architecture specification in units of four octets, so the delta
is multiplied by 4 to get bytes — the source of a great many capacity claims
that are exactly four times too low. And &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-x&lt;/code&gt; requests the extended
(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortCountersExtended&lt;/code&gt;) set; the basic counters are 32-bit, which at four
octets per unit is 17.2 GB of traffic before they wrap. On an HDR200 port
carrying 25 GB/s that is a wrap in well under a second, producing a negative
delta and, if your script does not check the sign, a negative or nonsensical
bandwidth. The snippet above does not check it either — add the guard before you
trust it unattended.&lt;/p&gt;

&lt;p&gt;Resist the urge to reach for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt;’s reset flags (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-r&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-R&lt;/code&gt;) first. On a
shared fabric you have just zeroed the inputs to somebody else’s monitoring, and
the difference method does not need it.&lt;/p&gt;

&lt;p&gt;The same discipline applies everywhere. NVMe wear counters, which carry a unit
almost nobody gets right on the first attempt:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvme smart-log /dev/nvme0n1 | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-iE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;data.units&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;data_units_read                     : 4,283,915,042
data_units_written                  : 1,118,730,455
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep&lt;/code&gt; pattern is deliberately loose because the field label changed:
older &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvme-cli&lt;/code&gt; prints &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;data_units_read&lt;/code&gt;, newer versions print
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Data Units Read&lt;/code&gt;, and a pattern pinned to the underscore form silently returns
nothing on half the fleet.&lt;/p&gt;

&lt;p&gt;A data unit here is a thousand 512-byte sectors — 512,000 bytes, not 512 and not
1 MiB. Assume 512 bytes and you are low by a factor of a thousand; assume 1 MiB
and you are high by a factor of 2.05. Sample twice, subtract, multiply by
512,000, divide by elapsed.&lt;/p&gt;

&lt;p&gt;And the ordinary network counters in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/proc/net/dev&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ethtool -S&lt;/code&gt; are
cumulative too. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sar -n DEV 5&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iostat -x 5&lt;/code&gt; do the differencing for you,
which is precisely why the first sample they print — the one covering time since
boot — should always be discarded:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;iostat &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; 5 2 nvme0n1     &lt;span class=&quot;c&quot;&gt;# use the SECOND report, not the first&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Another place the obvious reading is wrong. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iostat&lt;/code&gt; reports &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%util&lt;/code&gt;, and on a
spinning disk 100 percent &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%util&lt;/code&gt; meant the device was saturated. On NVMe it
means nothing of the kind. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%util&lt;/code&gt; is the fraction of wall time during which at
least one request was in flight. An NVMe drive with 64 hardware queues can be at
100 percent &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%util&lt;/code&gt; while servicing one request at a time and running at three
percent of its capability.&lt;/p&gt;

  &lt;p&gt;The fields that actually carry information are &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aqu-sz&lt;/code&gt;, the average queue
depth, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;r_await&lt;/code&gt;, the average service latency. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aqu-sz&lt;/code&gt; is the sysstat 12
name; on sysstat 11 and earlier the same field is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;avgqu-sz&lt;/code&gt;, so a parser that
greps for one of them will come back empty on the other. A device with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%util=100&lt;/code&gt;,
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aqu-sz=1.2&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;r_await=0.3&lt;/code&gt; ms is nearly idle. The same device at
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aqu-sz=180&lt;/code&gt; with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;r_await&lt;/code&gt; climbing run over run is the constraint. Judge NVMe
by queue depth and latency, never by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%util&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;4-aggregate-cpu-idle-proves-nothing-on-a-many-core-machine&quot;&gt;4. Aggregate CPU idle proves nothing on a many-core machine&lt;/h2&gt;

&lt;p&gt;On a dual-socket server with 96 physical cores and SMT enabled — 192 logical
CPUs — one thread pinned at 100 percent contributes 100 ÷ 192 = 0.52 percent to
the aggregate. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;top&lt;/code&gt; reports 99.5 percent idle. Every dashboard is green. The
job is bottlenecked on a single saturated core and the summary statistic
physically cannot show it.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mpstat&lt;/code&gt; has the answer, provided you ask for per-CPU output and an interval.
Run without an interval and it prints averages since boot, which returns you to
problem 3.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;C mpstat &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; ALL 5 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;14:03:16     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %idle
14:03:16     all    0.41    0.00    0.22    0.09    0.00    0.51    0.00   98.77
14:03:16       0    0.20    0.00    0.20    0.00    0.00    0.00    0.00   99.60
14:03:16       1    0.40    0.00    0.20    0.00    0.00    0.00    0.00   99.40
14:03:16      37    0.20    0.00    2.61    0.00    0.00   96.99    0.00    0.20
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;all&lt;/code&gt; says 98.8 percent idle. CPU 37 says 99.8 percent busy, essentially all of
it in softirq — and note that CPU 37’s 96.99 percent softirq shows up in the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;all&lt;/code&gt; row as 96.99 ÷ 192 = 0.51, which is the whole of the aggregate &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%soft&lt;/code&gt;
column. The evidence is present in the summary; it is just divided by 192. Sort
for the busiest core rather than reading the summary:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;C mpstat &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; ALL 5 1 | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;$2 ~ /^[0-9]+$/ {printf &quot;cpu%-4s busy %5.1f%%\n&quot;, $2, $3+$4+$5+$7+$8}&apos;&lt;/span&gt; | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-k3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-nr&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cpu37   busy  99.8%
cpu112  busy  41.2%
cpu38   busy   3.1%
cpu4    busy   1.1%
cpu0    busy   0.4%
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LC_ALL=C&lt;/code&gt; is load-bearing rather than decorative. In several locales sysstat
prints a 12-hour timestamp with a trailing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AM&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PM&lt;/code&gt;, which puts an extra field
at the front of every row and shifts &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$3&lt;/code&gt; onto &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%usr&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$4&lt;/code&gt; onto &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%nice&lt;/code&gt; and so
on — the awk above then sums the wrong columns and reports a plausible, wrong
number. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;S_TIME_FORMAT=ISO&lt;/code&gt; achieves the same fixed layout if you would rather
keep the locale.&lt;/p&gt;

&lt;p&gt;Summing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%usr + %nice + %sys + %irq + %soft&lt;/code&gt; rather than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;100 − %idle&lt;/code&gt; keeps
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%iowait&lt;/code&gt; out of the total. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%iowait&lt;/code&gt; is not CPU work; it is idle time that
happened to coincide with a blocked task, and on a 192-core box it is diluted by
exactly the same factor that hides the busy core.&lt;/p&gt;

&lt;p&gt;A single core at 96 percent softirq looks like receive-side packet processing
landing on one CPU. Confirm before acting:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;mlx5|nvme&apos;&lt;/span&gt; /proc/interrupts | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{print $1, $(NF)}&apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head
awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;NR==1 || /NET_RX/&apos;&lt;/span&gt; /proc/softirqs | &lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c1-120&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;Do not stop at “the interrupts are unbalanced, run irqbalance”. Read the column,
not just the total. On an RDMA path the payload does not traverse the kernel
network stack, so &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%soft&lt;/code&gt; on a verbs benchmark is rarely &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NET_RX&lt;/code&gt; — it is more
often completion-queue work landing on the single CPU the queue pair’s vector
was bound to, which &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;irqbalance&lt;/code&gt; will not move because RDMA drivers pin their
own vectors. And if the hot column is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%sys&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%usr&lt;/code&gt; rather than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%soft&lt;/code&gt;, the
busy core is not interrupt handling at all: it is a single-threaded submission
path, in the benchmark or in a filesystem daemon. Establish which before you
rebind anything:&lt;/p&gt;

  &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;top &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;pgrep &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;, &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;fio|mmfsd&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n1&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;  &lt;/div&gt;

  &lt;p&gt;If the hot thread belongs to your benchmark rather than to an interrupt, the
fix is more jobs, not IRQ affinity — and you are back at problem 2. Rebinding
interrupts to fix a problem that was never interrupts is how a tuning exercise
consumes a maintenance window and changes nothing.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;state-the-expected-value-before-you-measure&quot;&gt;State the expected value before you measure&lt;/h2&gt;

&lt;p&gt;The four mechanisms above share one property: in every case the wrong number
looked plausible. That is what made it survive. The defense is to decide what
the number should be &lt;em&gt;before&lt;/em&gt; you run anything, write the arithmetic down, and
treat agreement as weak evidence and disagreement as a finding.&lt;/p&gt;

&lt;p&gt;Build the budget layer by layer, cheapest measurement first. For a tier of eight
storage servers on HDR200 serving twelve clients:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Layer&lt;/th&gt;
      &lt;th&gt;Per unit&lt;/th&gt;
      &lt;th&gt;Count&lt;/th&gt;
      &lt;th&gt;Aggregate&lt;/th&gt;
      &lt;th&gt;How it was obtained&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Server DDR read bandwidth&lt;/td&gt;
      &lt;td&gt;~190 GiB/s&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;~1.5 TiB/s&lt;/td&gt;
      &lt;td&gt;8-channel DDR4-3200 per socket, arithmetic&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;NVMe random 128k read, per server&lt;/td&gt;
      &lt;td&gt;62 GiB/s&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;496 GiB/s&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fio&lt;/code&gt; against raw devices, measured&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;HCA PCIe link (Gen4 ×16)&lt;/td&gt;
      &lt;td&gt;29.3 GiB/s&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;234 GiB/s&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;current_link_speed&lt;/code&gt; × &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_width&lt;/code&gt;, 128b/130b, arithmetic&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Storage server NIC (HDR200, 200 Gb/s)&lt;/td&gt;
      &lt;td&gt;23.3 GiB/s&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;186 GiB/s&lt;/td&gt;
      &lt;td&gt;line rate, arithmetic&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Inter-switch links, under load&lt;/td&gt;
      &lt;td&gt;23.1 GiB/s&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;185 GiB/s&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt; delta, measured&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Client NIC (HDR200)&lt;/td&gt;
      &lt;td&gt;23.3 GiB/s&lt;/td&gt;
      &lt;td&gt;12&lt;/td&gt;
      &lt;td&gt;280 GiB/s&lt;/td&gt;
      &lt;td&gt;line rate, arithmetic&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Single client alone, all 12 idle&lt;/td&gt;
      &lt;td&gt;22.9 GiB/s&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;—&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fio&lt;/code&gt; on one node, measured&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Erasure-code read amplification&lt;/td&gt;
      &lt;td&gt;×1.88&lt;/td&gt;
      &lt;td&gt;—&lt;/td&gt;
      &lt;td&gt;99 GiB/s delivered&lt;/td&gt;
      &lt;td&gt;modeled from 8+2p, checked against &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The PCIe row is worth a caution, because it is the row most often quoted as a
measurement when it is nothing of the kind. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;current_link_speed&lt;/code&gt; and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;current_link_width&lt;/code&gt; under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/sys/bus/pci/devices/&lt;/code&gt; report what the link
negotiated, not what it carries: Gen4 ×16 at 16 GT/s with 128b/130b framing is
31.5 GB/s, or 29.3 GiB/s, and no adapter delivers that after TLP headers and
DMA overhead. Read it as a ceiling that is comfortably above the NIC line rate,
which is the only conclusion the row has to support here.&lt;/p&gt;

&lt;p&gt;The binding constraint for a cold read is the storage-side NIC aggregate,
reduced by the read amplification of the erasure code. With &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;k&lt;/code&gt; data strips
distributed one per node, delivering one byte to a client moves roughly
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1 + (k−1)/k&lt;/code&gt; bytes on the storage fabric: the node fronting the client holds
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1/k&lt;/code&gt; of the track locally, pulls the other &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(k−1)/k&lt;/code&gt; across the fabric from its
peers, and then sends the whole byte on to the client. For k = 8 that is 1.875.
186 ÷ 1.88 is 99 GiB/s of deliverable read bandwidth. The measured 82 GiB/s is
83 percent of that, which is a believable efficiency for a real filesystem and
is therefore not interesting.&lt;/p&gt;

&lt;p&gt;This is a model, not a measurement, and it is the weakest row in the table. It
assumes full-track reads with no coalescing and no parity-strip traffic on a
healthy array, and it will be wrong under rebuild, wrong for partial-track
reads, and wrong for any layout that places more than one strip per node. Treat
it as the right order of magnitude for the correction rather than a constant,
and confirm it by comparing fabric bytes from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt; against client bytes
from IOR on the same run.&lt;/p&gt;

&lt;p&gt;The 155.8 GiB/s figure is 157 percent of that budget. It is not physically
impossible — it sits at 84 percent of the raw 186 GiB/s NIC aggregate — but it
can only be reached by removing a layer from the path, and the excess tells you
which layer. A buffer-pool hit serves the reconstructed logical track from the
server’s own memory, so it skips both the NVMe read and the inter-node strip
gather, and the ×1.88 amplification disappears with them. The number went above
the budget because the budget’s most expensive term stopped applying. Reading it
as “the storage is faster than we modeled” inverts the finding exactly.&lt;/p&gt;

&lt;p&gt;That inversion is the whole discipline. A number that exceeds the budget is the
loudest alarm your benchmark can raise, and it is the one people are least likely
to investigate, because it is the number they wanted.&lt;/p&gt;

&lt;p&gt;Two unit traps will move a figure enough to matter. One GB is 10⁹ bytes and one
GiB is 2³⁰; the gap is 7.37 percent, and one step down the scale the MiB-to-MB
gap is 4.86 percent. fio prints both — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BW=6955MiB/s (7292MB/s)&lt;/code&gt; — and IOR
prints MiB/s only. Take fio’s binary figure, relabel it with the decimal unit,
and you understate by 4.9 percent at the MiB level or 7.4 percent at the GiB
level: roughly the size of the improvements people schedule maintenance windows
for. And link rates are decimal: HDR200 is 200 × 10⁹ bit/s, which is 25.0 GB/s
and 23.3 GiB/s, not 25.&lt;/p&gt;

&lt;h2 id=&quot;symptom-against-true-cause&quot;&gt;Symptom against true cause&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom&lt;/th&gt;
      &lt;th&gt;Tempting conclusion&lt;/th&gt;
      &lt;th&gt;Also consistent with&lt;/th&gt;
      &lt;th&gt;Check that distinguishes them&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Read ≫ write on symmetric hardware&lt;/td&gt;
      &lt;td&gt;Read path is better optimized&lt;/td&gt;
      &lt;td&gt;Read served from the server buffer pool&lt;/td&gt;
      &lt;td&gt;Re-run at 2× and 4× the pool size; cache gives a sharp fall then a floor&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Read phase finished in under 10 s&lt;/td&gt;
      &lt;td&gt;Fast storage&lt;/td&gt;
      &lt;td&gt;Working set fits in cache&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;total(s)&lt;/code&gt; in IOR; raise &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-b&lt;/code&gt; until the phase runs 60 s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Throughput flat across repeated runs&lt;/td&gt;
      &lt;td&gt;Saturation&lt;/td&gt;
      &lt;td&gt;Under-driven at a fixed, insufficient depth&lt;/td&gt;
      &lt;td&gt;Sweep &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;numjobs&lt;/code&gt;; a real ceiling is flat while concurrency quadruples&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Throughput flat as nodes are added&lt;/td&gt;
      &lt;td&gt;Aggregate ceiling&lt;/td&gt;
      &lt;td&gt;Per-node NIC or single-thread limit&lt;/td&gt;
      &lt;td&gt;Compare 1-node and N-node per-node rates&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iodepth&lt;/code&gt; raised, nothing changed&lt;/td&gt;
      &lt;td&gt;Queue already full&lt;/td&gt;
      &lt;td&gt;Synchronous ioengine ignoring &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iodepth&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep ioengine&lt;/code&gt; in the job file&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%util&lt;/code&gt; at 100 percent&lt;/td&gt;
      &lt;td&gt;Device saturated&lt;/td&gt;
      &lt;td&gt;One request in flight on a 64-queue device&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aqu-sz&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;r_await&lt;/code&gt;, not &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%util&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Rate falls as runtime rises&lt;/td&gt;
      &lt;td&gt;Thermal or cache-fill effect&lt;/td&gt;
      &lt;td&gt;Cumulative counter divided by elapsed&lt;/td&gt;
      &lt;td&gt;Sample the counter twice and difference&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Bandwidth exactly 4× too low&lt;/td&gt;
      &lt;td&gt;Link running at 1X&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitData&lt;/code&gt; read without the ×4&lt;/td&gt;
      &lt;td&gt;Multiply the delta by 4; confirm width with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibstatus&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;CPU 98 percent idle under load&lt;/td&gt;
      &lt;td&gt;Not CPU-bound&lt;/td&gt;
      &lt;td&gt;One core at 100 percent out of 192&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mpstat -P ALL&lt;/code&gt;, sort by busiest core&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Total rises as clients are added&lt;/td&gt;
      &lt;td&gt;Storage scales&lt;/td&gt;
      &lt;td&gt;You were client-limited the whole time&lt;/td&gt;
      &lt;td&gt;Per-node rate at 1 node versus N nodes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Second run much faster than the first&lt;/td&gt;
      &lt;td&gt;Warm-up effect&lt;/td&gt;
      &lt;td&gt;Second run read what the first run wrote&lt;/td&gt;
      &lt;td&gt;IOR &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-C&lt;/code&gt;, and drop client caches between phases&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Bandwidth and latency both healthy, job still slow&lt;/td&gt;
      &lt;td&gt;Storage is fine&lt;/td&gt;
      &lt;td&gt;Metadata-bound, not bandwidth-bound&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mdtest&lt;/code&gt; create/stat/remove rates&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Array tool reports twice what &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fio&lt;/code&gt; reports&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fio&lt;/code&gt; is misconfigured&lt;/td&gt;
      &lt;td&gt;Fabric counters include the strip gather&lt;/td&gt;
      &lt;td&gt;Compare the ratio against &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1 + (k−1)/k&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Result matches the vendor datasheet&lt;/td&gt;
      &lt;td&gt;Configured correctly&lt;/td&gt;
      &lt;td&gt;Measured a cache, or copied the expectation&lt;/td&gt;
      &lt;td&gt;Compute the budget independently first&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;what-to-keep&quot;&gt;What to keep&lt;/h2&gt;

&lt;p&gt;Three habits close most of the gap.&lt;/p&gt;

&lt;p&gt;Write the expected number down before the run, with the arithmetic that produced
it, in the same file as the result. This costs five minutes and converts every
benchmark from a measurement into a test with a pass condition.&lt;/p&gt;

&lt;p&gt;Never report a single point. Report a sweep, and report the shape. “82 GiB/s”
is a claim; “82 GiB/s, flat within one percent from 1,536 to 6,144 outstanding
I/Os, at 3 TiB against a 241 GiB server buffer pool” is a result somebody else
can check.&lt;/p&gt;

&lt;p&gt;And when the number comes out better than you expected, stop and find out why
before telling anyone. In the shape of problem described here, that is nearly
always the moment the measurement broke.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>NVIDIA driver and kernel upgrades: qualify the booted stack as one release</title>
    <link href="https://www.wirewalk.com/writing/nvidia-driver-kernel-upgrade-release-unit/"/>
    <published>2026-03-09T10:00:00-04:00</published>
    <updated>2026-03-09T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nvidia-driver-kernel-upgrade-release-unit/</id>
    <summary>Plan GPU-node upgrades around the running kernel, module trust, userspace libraries and workload tests, with an image-level rollback that can actually boot.</summary>
    <content type="html">&lt;p&gt;A driver package can install successfully while the next boot has no usable GPU. The running kernel may differ from the one whose development files were installed, the new module may not load under Secure Boot, or the application may resolve userspace libraries from an unexpected location.&lt;/p&gt;

&lt;p&gt;Treat the kernel, GPU driver and its dependent workload path as a release unit. The package transaction is one step. The acceptance result comes from a booted canary running the jobs the service is expected to support.&lt;/p&gt;

&lt;h2 id=&quot;capture-the-old-release-before-changing-it&quot;&gt;Capture the old release before changing it&lt;/h2&gt;

&lt;p&gt;Record the running kernel, installed kernel packages, GPU driver, firmware inventory where relevant, CUDA toolkit, container runtime and scheduler integration. Preserve the known-good image or package set through the site’s supported release process.&lt;/p&gt;

&lt;p&gt;Read-only observations on a candidate node can begin with:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;uname&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;
nvidia-smi &lt;span class=&quot;nt&quot;&gt;--query-gpu&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;name,uuid,driver_version &lt;span class=&quot;nt&quot;&gt;--format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;csv
modinfo nvidia
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/driver/nvidia/version
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;modinfo&lt;/code&gt; reports the module found through its lookup path; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/proc&lt;/code&gt; provides information about the loaded driver when available. A difference between installed and loaded state deserves explanation before the upgrade proceeds.&lt;/p&gt;

&lt;p&gt;Save a short representative workload’s output and timing as the comparison point. Avoid treating a single benchmark number as a complete baseline. Include correctness, peak memory and the time spent initializing the application.&lt;/p&gt;

&lt;h2 id=&quot;choose-a-supported-combination&quot;&gt;Choose a supported combination&lt;/h2&gt;

&lt;p&gt;Use NVIDIA’s supported driver and distribution guidance together with the requirements of the deployed application stack. A newer package is not automatically compatible with every older filesystem client, RDMA component or container integration on the node.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.nvidia.com/cuda/archive/12.6.3/cuda-installation-guide-linux/index.html&quot;&gt;CUDA 12.6.3 Linux installation guide&lt;/a&gt; describes the role of matching kernel development components in driver builds. Confirm the actual boot target and the applicable distribution packaging method. Precompiled modules and locally built modules have different operating requirements.&lt;/p&gt;

&lt;p&gt;Keep security updates within the decision. A performance regression investigation is not a reason to leave a known security requirement unowned. Record the constraint and work with the supported vendor path rather than quietly freezing the stack indefinitely.&lt;/p&gt;

&lt;h2 id=&quot;verify-module-trust-and-boot-artifacts&quot;&gt;Verify module trust and boot artifacts&lt;/h2&gt;

&lt;p&gt;Where Secure Boot applies, establish how modules are signed and trusted under site policy. Check the distribution’s supported enrollment or signing workflow. Disabling Secure Boot as a routine installation shortcut changes a security property and does not solve the release-management problem.&lt;/p&gt;

&lt;p&gt;Inspect the selected kernel, required modules and initramfs contents through the platform’s supported tools. A module present on the root filesystem may still be unavailable when an early-boot dependency needs it. An image-building environment can also lack the running node’s hardware and service state, so image success must be followed by boot testing.&lt;/p&gt;

&lt;p&gt;For BCM-managed nodes, qualify the image and the provisioning path together. A manual repair made only on the canary should be transferred into the controlled image before the result is called repeatable.&lt;/p&gt;

&lt;h2 id=&quot;separate-driver-capability-from-the-application-runtime&quot;&gt;Separate driver capability from the application runtime&lt;/h2&gt;

&lt;p&gt;The CUDA version displayed by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-smi&lt;/code&gt; describes driver-supported capability, not a complete inventory of the toolkit or framework runtime the application loaded. Record the actual application environment, including container digest and framework build.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.nvidia.com/deploy/cuda-compatibility/index.html&quot;&gt;NVIDIA’s CUDA compatibility documentation&lt;/a&gt; explains the compatibility model and its conditions. Use the relevant versioned requirements when qualifying an older container against a changed host driver. A successful import or version print is weaker evidence than executing the workload.&lt;/p&gt;

&lt;p&gt;Test the container path separately from the host path. Device discovery, library injection, GPU memory allocation and actual kernel execution exercise different dependencies. Keep the ordinary-user context and scheduler device restrictions in the test.&lt;/p&gt;

&lt;h2 id=&quot;build-an-acceptance-ladder&quot;&gt;Build an acceptance ladder&lt;/h2&gt;

&lt;p&gt;Begin with inventory and a bounded CUDA operation on one GPU. Then run a representative container, a storage read and checkpoint write/readback, and an allocation that verifies cleanup. Check logs for new errors during each step.&lt;/p&gt;

&lt;p&gt;Where the service supports distributed training, add a small multi-node communication test using the supported MPI or NCCL stack. Select known-good peers so a failure can be narrowed to the candidate. A single-node test cannot establish that GPU Direct RDMA or the intended collective path still works.&lt;/p&gt;

&lt;p&gt;Compare end-to-end behavior with the saved baseline. Look at startup, steady state and shutdown separately. A change may leave kernel execution fast while delaying initialization or breaking process cleanup after cancellation.&lt;/p&gt;

&lt;p&gt;Do not run intrusive stress or diagnostics beside production jobs without an agreed window. The canary should remain unavailable to ordinary users until the defined acceptance ladder passes.&lt;/p&gt;

&lt;h2 id=&quot;make-rollback-a-boot-test&quot;&gt;Make rollback a boot test&lt;/h2&gt;

&lt;p&gt;Keep a known-good bootable image or supported kernel/driver combination, along with out-of-band access. Write down how to select it if normal SSH never returns. Reversing a package transaction after a failed boot is not a practical plan if nobody can reach the machine.&lt;/p&gt;

&lt;p&gt;Test rollback on the canary and re-run the essential workload checks. Confirm that the scheduler, mounts and monitoring return to the expected state. Preserve scientific data independently of the operating-system rollback; restoring an image is not a research-data recovery mechanism.&lt;/p&gt;

&lt;p&gt;Record which state rollback does not undo. Firmware, external configuration and shared storage may have separate lifecycles. If the release changes one of those, its recovery plan needs explicit treatment rather than being hidden under the word image.&lt;/p&gt;

&lt;h2 id=&quot;roll-forward-in-meaningful-cohorts&quot;&gt;Roll forward in meaningful cohorts&lt;/h2&gt;

&lt;p&gt;Choose a small initial group covering the relevant hardware classes and workload types. Observe normal jobs before expanding. Retain a clear stop condition for repeated boot failures, new GPU errors, missing mounts or reproducible application regressions.&lt;/p&gt;

&lt;p&gt;The final release record should identify the booted stack, test evidence, rollout population and rollback result. That lets the next administrator determine whether a failure is an application issue or a node running a different qualified configuration.&lt;/p&gt;

&lt;p&gt;For enforcing the resulting allocation boundary, see &lt;a href=&quot;/writing/slurm-cgroup-v2-gpu-isolation-validation/&quot;&gt;Slurm GPU isolation validation&lt;/a&gt;. An upgrade is complete when the service works through that boundary, not when the installer exits successfully.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Redfish telemetry: keep hardware identity, units and sample freshness together</title>
    <link href="https://www.wirewalk.com/writing/redfish-telemetry-inventory-freshness/"/>
    <published>2026-03-05T10:00:00-05:00</published>
    <updated>2026-03-05T10:00:00-05:00</updated>
    <id>https://www.wirewalk.com/writing/redfish-telemetry-inventory-freshness/</id>
    <summary>Build read-only Redfish collection around resource discovery, sensor identity, timestamps and explicit missing-data states, then validate it against scheduler and node observations.</summary>
    <content type="html">&lt;p&gt;A management controller can answer an HTTPS request while the operating system is unresponsive. It can also return a report whose measurements were collected earlier than the request. Both facts make Redfish useful, and both make simplistic health checks misleading.&lt;/p&gt;

&lt;p&gt;A reliable collector needs to retain the relationship between a chassis, a component, a measurement and its observation time. The dashboard should show uncertainty when that relationship is missing. It should not turn a missing sensor into a temperature of zero or treat an old power sample as current load.&lt;/p&gt;

&lt;p&gt;This article concerns read-only telemetry. Changing firmware settings, creating subscriptions or controlling power belongs in a separately authorized management workflow.&lt;/p&gt;

&lt;h2 id=&quot;discover-resources-instead-of-guessing-member-names&quot;&gt;Discover resources instead of guessing member names&lt;/h2&gt;

&lt;p&gt;Start at the service root and follow the advertised collections. System and chassis identifiers vary between implementations, as do the relationships between them. A hard-coded path copied from one BMC can work across a small fleet and then quietly omit a new hardware family.&lt;/p&gt;

&lt;p&gt;Record the controller’s supported schema versions and which resources it actually exposes. Redfish standardization does not mean every optional service or sensor exists on every device. Treat an absent TelemetryService as a capability result, not automatically as a failed server.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://redfish.dmtf.org/schemas/DSP2046_2020.1.html&quot;&gt;DMTF Redfish resource guide for the 2020.1 schema bundle&lt;/a&gt; provides an established reference for resource structure. Use the implementation’s declared schema and vendor documentation when deciding which properties are available.&lt;/p&gt;

&lt;h2 id=&quot;maintain-a-hardware-inventory-outside-the-graph&quot;&gt;Maintain a hardware inventory outside the graph&lt;/h2&gt;

&lt;p&gt;Map management endpoints to physical systems using stable inventory evidence such as serial numbers and component relationships. Keep the mapping under review when a board, controller or chassis is replaced. An IP address can be reassigned; it is not permanent hardware identity.&lt;/p&gt;

&lt;p&gt;Store enough context to distinguish a chassis power reading from a CPU or GPU component reading. A display label such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Power&lt;/code&gt; is not an adequate key when several resources use it. Preserve the resource URI and the relevant identity alongside the human-readable label.&lt;/p&gt;

&lt;p&gt;Do not put credentials into metric labels, log URLs or screenshots. Use the approved secret store and TLS trust configuration. A read-only collector still has access to infrastructure details that should not be publicly exposed.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-collection-time-from-report-arrival&quot;&gt;Distinguish collection time from report arrival&lt;/h2&gt;

&lt;p&gt;Retain the timestamp associated with each metric value where provided, the report timestamp and the collector’s receipt time. Their meanings can differ. Do not replace the sensor’s time with the moment an HTTP request completed and then claim a fresh observation.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.dmtf.org/sites/default/files/standards/documents/DSP2051_1.0.1.pdf&quot;&gt;DMTF Telemetry white paper&lt;/a&gt; describes report definitions and metric values. Read the definition as well as the report: a value may summarize an interval or be generated according to a reporting policy rather than representing an instantaneous sensor read.&lt;/p&gt;

&lt;p&gt;For a hypothetical report, the collector might receive data at 12:05 while a metric’s observation timestamp is 12:01. A four-minute age may be acceptable for inventory trending and unsuitable for a rapid thermal alert. Freshness policy should follow the operational use, with clock uncertainty considered explicitly.&lt;/p&gt;

&lt;h2 id=&quot;carry-units-and-scope-through-every-transformation&quot;&gt;Carry units and scope through every transformation&lt;/h2&gt;

&lt;p&gt;Normalize units only with a documented conversion. Retain the original value and unit in troubleshooting evidence when practical. A number copied into a generic &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;power&lt;/code&gt; series without identifying watts, aggregation scope and interval is difficult to interpret later.&lt;/p&gt;

&lt;p&gt;Determine whether the reading is instantaneous, averaged, cumulative or a limit. Summing average chassis power readings over time without accounting for interval length does not produce an energy value. Summing overlapping chassis and component readings can double-count the same consumption.&lt;/p&gt;

&lt;p&gt;Validate a few samples against the BMC’s own supported interface and a known controlled workload. Agreement will not establish laboratory measurement accuracy, but it can expose unit conversion, resource-mapping or parser errors.&lt;/p&gt;

&lt;h2 id=&quot;represent-missing-and-failed-data-explicitly&quot;&gt;Represent missing and failed data explicitly&lt;/h2&gt;

&lt;p&gt;Distinguish unsupported properties, absent components, stale samples, authentication failure, transport failure and valid zero values. These states call for different responses. A dashboard should let a responder tell whether the sensor reported something unusual or the collector stopped receiving evidence.&lt;/p&gt;

&lt;p&gt;Test malformed and partial responses with local fixtures. Preserve unknown fields where the parser needs them for forward compatibility, but validate the fields used in decisions. An empty array should not pass a check merely because its HTTP response was successful.&lt;/p&gt;

&lt;p&gt;Bound polling and retries. A fleet collector that retries every missing reading immediately can overload slow controllers during an incident. Use a reasonable schedule and backoff, and measure controller responsiveness before increasing collection frequency.&lt;/p&gt;

&lt;h2 id=&quot;join-telemetry-with-node-and-scheduler-evidence&quot;&gt;Join telemetry with node and scheduler evidence&lt;/h2&gt;

&lt;p&gt;A chassis reporting normal power does not establish that Slurm can start a job. Conversely, a job waiting in the queue does not imply a hardware fault. Keep management-controller observations, OS health and scheduler state as distinct evidence streams with a shared identity map.&lt;/p&gt;

&lt;p&gt;For NVIDIA systems, use host GPU telemetry where appropriate rather than assuming the BMC exposes every accelerator detail. Check that the host and BMC observations refer to the same device and time interval before presenting them together.&lt;/p&gt;

&lt;p&gt;Make the alert describe the evidence it has. A stale BMC reading should trigger a collection or management-path investigation; it should not be mislabeled as a measured thermal emergency. Automatic drain or power action requires an additional policy with its own validation and recovery behavior.&lt;/p&gt;

&lt;h2 id=&quot;test-lifecycle-changes-before-fleet-rollout&quot;&gt;Test lifecycle changes before fleet rollout&lt;/h2&gt;

&lt;p&gt;On a representative maintenance system, check behavior across an OS reboot, a BMC restart and a temporary collector outage. Record which identities persist, how timestamps behave and when readings become available again. Keep those observations specific to the tested hardware and firmware.&lt;/p&gt;

&lt;p&gt;Then add a second hardware family before assuming the parser generalizes. A small compatibility matrix is more useful than a collector that silently skips unfamiliar resources.&lt;/p&gt;

&lt;p&gt;For actions that change system state, see &lt;a href=&quot;/writing/redfish-automation-state-machines-tasks-etags/&quot;&gt;Redfish automation state machines&lt;/a&gt;. Reliable telemetry supports those decisions, but a sensor report should never be treated as permission to perform them.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Management networks: isolate the systems that can rebuild everything</title>
    <link href="https://www.wirewalk.com/writing/management-network-bmc-isolation/"/>
    <published>2026-02-26T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/management-network-bmc-isolation/</id>
    <summary>BMCs, hypervisors, storage controllers, and provisioning services belong in the privileged-access model.</summary>
    <content type="html">&lt;p&gt;A BMC can power off a host that the operating system has carefully secured. A provisioning service can replace its image. Put those management routes, their credentials and their recovery access through a separate review.&lt;/p&gt;

&lt;h2 id=&quot;inventory-privileged-control-planes&quot;&gt;Inventory privileged control planes&lt;/h2&gt;

&lt;p&gt;Include Dell iDRAC, HPE iLO, hypervisor managers, storage administration, switch management, backup consoles, and image repositories. Record the supported firmware or software release and the intended management route.&lt;/p&gt;

&lt;p&gt;Do not discover authority solely by scanning ports. Some capabilities exist behind a shared API or reverse proxy, while an open port says little about who can use it. Pair network observations with configuration and role review.&lt;/p&gt;

&lt;h2 id=&quot;specify-allowed-flows&quot;&gt;Specify allowed flows&lt;/h2&gt;

&lt;p&gt;Use an explicit matrix rather than “management VLAN accessible to IT”:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Source&lt;/th&gt;
      &lt;th&gt;Destination&lt;/th&gt;
      &lt;th&gt;Purpose&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Approved admin workstation/bastion&lt;/td&gt;
      &lt;td&gt;Selected management interface&lt;/td&gt;
      &lt;td&gt;Interactive administration&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Monitoring service&lt;/td&gt;
      &lt;td&gt;Read-only management endpoint&lt;/td&gt;
      &lt;td&gt;Health collection&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Provisioning service&lt;/td&gt;
      &lt;td&gt;Defined hosts and repositories&lt;/td&gt;
      &lt;td&gt;Controlled image lifecycle&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Ordinary user network&lt;/td&gt;
      &lt;td&gt;Management interface&lt;/td&gt;
      &lt;td&gt;Denied unless specifically justified&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;This is a design example. Actual protocols and ports come from the installed product documentation. Some products need additional flows for discovery, virtual media, or telemetry.&lt;/p&gt;

&lt;h2 id=&quot;validate-identity-and-transport&quot;&gt;Validate identity and transport&lt;/h2&gt;

&lt;p&gt;Redfish is a standardized management API, but implementations, authentication, and available resources differ. Use &lt;a href=&quot;https://www.dmtf.org/standards/redfish&quot;&gt;DMTF’s Redfish specifications&lt;/a&gt; and the hardware vendor’s release documentation. Do not assume one manufacturer’s endpoint layout or role model applies to another.&lt;/p&gt;

&lt;p&gt;Use named administrative identities where supported, restrict automation to required operations, and validate certificates. An emergency script that disables TLS verification permanently removes an important check from a highly privileged path.&lt;/p&gt;

&lt;h2 id=&quot;test-isolation-without-changing-host-power&quot;&gt;Test isolation without changing host power&lt;/h2&gt;

&lt;p&gt;From an approved administrator path, verify an authorized read-only health operation. From a representative ordinary client network, confirm the management service is unreachable or access is denied as designed. Test IPv4 and IPv6 where both are deployed.&lt;/p&gt;

&lt;p&gt;Then verify emergency console access to a pilot host under a documented procedure. Do not issue resets or power operations simply to test API authentication.&lt;/p&gt;

&lt;h2 id=&quot;keep-management-available-during-an-outage&quot;&gt;Keep management available during an outage&lt;/h2&gt;

&lt;p&gt;Avoid making the only recovery route depend on the application network being repaired. Document access during firewall failure, directory outage, and loss of the primary bastion. Protect recovery credentials separately and monitor their use.&lt;/p&gt;

&lt;p&gt;A segmented network with one shared administrator password still has a concentrated credential risk. Conversely, excellent identity controls do not justify exposing management services unnecessarily.&lt;/p&gt;

&lt;h2 id=&quot;acceptance-record&quot;&gt;Acceptance record&lt;/h2&gt;

&lt;p&gt;Keep the inventory, allowed-flow matrix, read-only access tests, denied-path tests, firmware review, and emergency-access procedure. Repeat after network changes and hardware additions. Revisit the matrix whenever hardware is added or network routes change; an old VLAN diagram will not capture those changes on its own.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>When a storage read ceiling is really an InfiniBand routing problem</title>
    <link href="https://www.wirewalk.com/writing/when-storage-is-actually-the-fabric/"/>
    <published>2026-02-11T10:00:00-05:00</published>
    <updated>2026-02-11T10:00:00-05:00</updated>
    <id>https://www.wirewalk.com/writing/when-storage-is-actually-the-fabric/</id>
    <summary>How to tell a parallel filesystem read ceiling apart from a static-routing collapse on the inter-switch links, using per-ISL counter deltas and a network-only corroboration test. Includes the elimination order and the one command that would have answered it on the first morning.</summary>
    <content type="html">&lt;p&gt;This read/write imbalance is easy to mistake for a storage problem.
A parallel filesystem writes close to the number the design predicted and reads
at roughly half that. Nothing is saturated. Client adapters sit well below half
their line rate, the storage servers are not CPU-bound, the disks are not busy,
and fabric monitoring shows aggregate utilization in the twenties. Every component
reports headroom and the aggregate refuses to move. On the storage servers,
during the read phase that is supposedly the problem:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ iostat -x 5 | grep -E &apos;Device|nvme0n1&apos;   # write-side columns trimmed
Device   r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz  aqu-sz  %util
nvme0n1  812.4  830617.6    0.0   0.00    0.41   1022.6    0.33  31.20
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thirty-one percent device utilization and sub-millisecond read latency, with a
queue that never gets deeper than a third of one outstanding request. The disks
are not the constraint.&lt;/p&gt;

&lt;p&gt;The reflex is to call it a storage problem, because the number you are unhappy
with came out of a storage benchmark. That reflex is usually wrong when the
asymmetry is this clean. Read and write paths share almost everything. The short
list of genuine differences is readahead, the disk-side read/write mix, and the
direction the bytes travel. Rule out the first two and the third is not an exotic
explanation, it is the only one left.&lt;/p&gt;

&lt;h2 id=&quot;why-the-fabric-is-a-plausible-suspect-at-all&quot;&gt;Why the fabric is a plausible suspect at all&lt;/h2&gt;

&lt;p&gt;InfiniBand unicast routing, in the configuration almost everyone runs, is static
and destination-based. Each switch holds a linear forwarding table mapping a
destination LID to exactly one output port. Not a set of ports, not a hash over
flows — one port. Every packet addressed to that LID leaves through that cable
for as long as the table stands.&lt;/p&gt;

&lt;p&gt;Where two switches are joined by several inter-switch links, the subnet manager
decides which link each destination uses. OpenSM’s default engine is Min Hop,
and its balancing rule is in its own documentation: among ports offering the same
hop count, pick the one with fewer LIDs already assigned. That is round-robin
over destinations.&lt;/p&gt;

&lt;p&gt;Read that rule again, because the whole article is in it. The engine balances the
&lt;strong&gt;number of destination addresses&lt;/strong&gt; per output port. It has no idea which of
those addresses carry traffic, how much, or when. Two ports holding eight LIDs
each are equally loaded as far as the routing engine is concerned, even if all
the traffic in the cluster is addressed to three LIDs that happen to share one
port.&lt;/p&gt;

&lt;p&gt;Apply that to a filesystem and the two directions stop being symmetric:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Writes&lt;/strong&gt; are addressed to the storage servers. Eight of them over eight
inter-switch links, and round-robin over eight consecutive GUIDs puts one
storage LID on each. The spread is perfect. That is not good engineering, it is
small-&lt;em&gt;n&lt;/em&gt; luck — reliable luck, which is why nobody notices.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Reads&lt;/strong&gt; are addressed to the clients, drawn from a much larger pool: every
compute node in the subnet, not just the ones in this job. Where a given client
lands in the global round-robin has nothing to do with whether it is running
your job. If the spacing between your job’s nodes in the routing order aliases
against the number of links, groups of them share one cable and other cables
carry nothing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The aliasing is not hypothetical. OpenSM ships an option whose purpose is to
break it — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scatter_ports&lt;/code&gt;, documented as randomizing port selection “rather than
using a round-robin algorithm (which is the default)”. Options do not get written
for problems nobody has.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;I would not try to predict from first principles which links a given fabric
collapses onto. The alignment depends on GUID ordering, discovery order, how many
LIDs sit behind the same links, and whether the tables were computed before or
after the last cable was plugged in. Measure it; the measurement is cheap and the
prediction is not.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;finding-the-inter-switch-links&quot;&gt;Finding the inter-switch links&lt;/h2&gt;

&lt;p&gt;Before any counters, establish which physical ports are ISLs and confirm they run
at the width and rate you think. One link that came up at 1X instead of 4X
produces a similar-looking aggregate shortfall from a completely different cause,
and it is embarrassing to find in week two.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ibswitches
Switch  : 0x043f720300xxxxxx ports 40 &quot;SwitchA&quot; enhanced port 0 lid 1 lmc 0
Switch  : 0x043f720300yyyyyy ports 40 &quot;SwitchB&quot; enhanced port 0 lid 2 lmc 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ iblinkinfo -S 0x043f720300yyyyyy | grep -i switch
       2   25[  ] ==( 4X  53.125 Gbps Active/  LinkUp)==&amp;gt;  1   13[  ] &quot;SwitchA&quot;
       2   26[  ] ==( 4X  53.125 Gbps Active/  LinkUp)==&amp;gt;  1   14[  ] &quot;SwitchA&quot;
       2   27[  ] ==( 4X  53.125 Gbps Active/  LinkUp)==&amp;gt;  1   15[  ] &quot;SwitchA&quot;
       2   28[  ] ==( 4X  53.125 Gbps Active/  LinkUp)==&amp;gt;  1   16[  ] &quot;SwitchA&quot;
       2   29[  ] ==( 4X  53.125 Gbps Active/  LinkUp)==&amp;gt;  1   17[  ] &quot;SwitchA&quot;
       2   30[  ] ==( 4X  53.125 Gbps Active/  LinkUp)==&amp;gt;  1   18[  ] &quot;SwitchA&quot;
       2   31[  ] ==( 4X  53.125 Gbps Active/  LinkUp)==&amp;gt;  1   19[  ] &quot;SwitchA&quot;
       2   32[  ] ==( 4X  53.125 Gbps Active/  LinkUp)==&amp;gt;  1   20[  ] &quot;SwitchA&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Eight links, all 4X, all at the same per-lane rate. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo&lt;/code&gt; prints the
&lt;strong&gt;per-lane&lt;/strong&gt; figure, not the link figure: 53.125 Gbps across four lanes is HDR, a
200 Gb/s link. Read that column as the link rate and you will invent a capacity
problem that does not exist.&lt;/p&gt;

&lt;p&gt;The second trap is to take the encoding overhead off twice. HDR uses 64b/66b line
coding, but the 200 Gb/s that everyone quotes for 4X HDR is the IBTA &lt;em&gt;data&lt;/em&gt; rate,
already net of that coding — the per-lane signalling rate is the 53.125 Gbps in
the column above. The same relationship holds one generation down, where EDR’s
25.78125 Gbps per lane × 64/66 is exactly 25, and 4X EDR is exactly 100 Gb/s.
Dividing 200 by 66/64 a second time gets you 193.9 Gb/s and a ceiling that is 3%
too low for no reason.&lt;/p&gt;

&lt;p&gt;So: 200 Gb/s is 25 GB/s, or 23.3 GiB/s, and that is the theoretical figure.
Subtract IB transport headers, ICRC and flow control and a healthy 4X HDR link
delivers around &lt;strong&gt;22.6 GiB/s&lt;/strong&gt; of payload in practice, which is roughly what
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; returns on an idle one. That 22.6 is the per-link ceiling used
throughout this article, and eight links give about 180.8 GiB/s each way. It is a
measured number rather than a derived one, so measure it on your own hardware
before you quote a percentage against it.&lt;/p&gt;

&lt;h2 id=&quot;reading-per-isl-counters&quot;&gt;Reading per-ISL counters&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt; reads the performance management agent on a switch port. Query the
ISL ports on one switch and you get both directions from one place:
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitData&lt;/code&gt; leaves that port toward the far switch, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortRcvData&lt;/code&gt; arrives from
it. On a switch at the storage side, reads are &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitData&lt;/code&gt; and writes are
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortRcvData&lt;/code&gt;. Use the extended counters; at these rates it is not optional:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ perfquery -x 2 25
# Port extended counters: Lid 2 port 25
PortSelect:......................25
CounterSelect:...................0x0000
PortXmitData:....................347892350976
PortRcvData:.....................183609851904
PortXmitPkts:....................339741882
PortRcvPkts:.....................179309714
PortUnicastXmitPkts:.............339740115
PortUnicastRcvPkts:..............179307946
PortMulticastXmitPkts:...........1767
PortMulticastRcvPkts:............1768
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two things about those numbers before you divide anything by anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The data counters are in units of four octets.&lt;/strong&gt; The IBA specification defines
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitData&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortRcvData&lt;/code&gt; as the number of data octets divided by four,
summed over all virtual lanes. Multiply by 4 to get bytes. Forget this and you get a
number four times too small — comfortingly close to a quarter of link rate, and
exactly the kind of wrong answer that survives a sanity check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The basic 32-bit counters wrap in well under a second.&lt;/strong&gt; A 32-bit counter in
units of 4 octets tops out at 2^32 × 4 = 17.18 GB, or 16 GiB. On an HDR link
carrying 21.6 GiB/s that is 0.74 seconds; on NDR, half that. Sample the basic
counters over a 60-second window and you are measuring the remainder after eighty
wraps. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-x&lt;/code&gt; flag, and only that flag, gives the 64-bit versions. The extended
counter attribute is optional in the specification — a device advertises it in
the performance class &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CapabilityMask&lt;/code&gt; — but present on anything you are likely
to be buying.&lt;/p&gt;

&lt;p&gt;One counter does not come along for the ride. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt;, which matters later,
lives in the basic &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortCounters&lt;/code&gt; attribute and not in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortCountersExtended&lt;/code&gt;, so
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery -x&lt;/code&gt; will not show it. Read it with plain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt;, and remember it
is 32 bits wide like everything else in that attribute.&lt;/p&gt;

&lt;h2 id=&quot;sampling-twice-and-differencing&quot;&gt;Sampling twice and differencing&lt;/h2&gt;

&lt;p&gt;Counters are cumulative. The measurement is a difference over a known interval
while a known workload runs. Do not reset them if anything else on the site reads
them; you will corrupt a monitoring baseline, and the delta method does not need
a reset.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# per-ISL throughput, both directions, over a fixed window&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;SW_LID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;2
&lt;span class=&quot;nv&quot;&gt;PORTS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;25 26 27 28 29 30 31 32&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;WINDOW&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;60

sample&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;p &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$PORTS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
    &lt;/span&gt;perfquery &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SW_LID&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$p&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
      | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$p&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;
          /^PortXmitData:/ { gsub(/[^0-9]/,&quot;&quot;,$0); x=$0 }
          /^PortRcvData:/  { gsub(/[^0-9]/,&quot;&quot;,$0); r=$0 }
          END { print p, x, r }&apos;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

sample &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /tmp/isl.t0
&lt;span class=&quot;nb&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$WINDOW&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
sample &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /tmp/isl.t1

&lt;span class=&quot;nb&quot;&gt;join&lt;/span&gt; /tmp/isl.t0 /tmp/isl.t1 | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$WINDOW&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;
  { dx=($4-$2)*4; dr=($5-$3)*4;
    printf &quot;port %-3s  xmit %7.2f GiB/s   rcv %7.2f GiB/s\n&quot;,
           $1, dx/w/1073741824, dr/w/1073741824 }&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gsub&lt;/code&gt; is there because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt; pads with dots rather than whitespace, so
the value is not in a predictable field. Parsing it as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$2&lt;/code&gt; works on some
releases and silently returns zero on others.&lt;/p&gt;

&lt;p&gt;Run it twice: once under a write-only workload, once under a read-only workload
over a dataset too large for client or server page cache. If the read set fits in
cache you measure memory, get a spectacular number and learn nothing.&lt;/p&gt;

&lt;h2 id=&quot;the-table-that-ends-the-argument&quot;&gt;The table that ends the argument&lt;/h2&gt;

&lt;p&gt;A twelve-client run against eight storage servers, sampled over 60 seconds on the
storage-side switch. The left columns are measured; the right two come from the
forwarding table, which comes next.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;ISL port&lt;/th&gt;
      &lt;th&gt;Write run, GiB/s&lt;/th&gt;
      &lt;th&gt;Read run, GiB/s&lt;/th&gt;
      &lt;th&gt;Read-run link use&lt;/th&gt;
      &lt;th&gt;Active client LIDs routed here&lt;/th&gt;
      &lt;th&gt;Total LFT entries via this port&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;25&lt;/td&gt;
      &lt;td&gt;11.2&lt;/td&gt;
      &lt;td&gt;21.6&lt;/td&gt;
      &lt;td&gt;96%&lt;/td&gt;
      &lt;td&gt;6&lt;/td&gt;
      &lt;td&gt;9&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;26&lt;/td&gt;
      &lt;td&gt;11.6&lt;/td&gt;
      &lt;td&gt;21.3&lt;/td&gt;
      &lt;td&gt;94%&lt;/td&gt;
      &lt;td&gt;5&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;27&lt;/td&gt;
      &lt;td&gt;11.4&lt;/td&gt;
      &lt;td&gt;7.4&lt;/td&gt;
      &lt;td&gt;33%&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;9&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;28&lt;/td&gt;
      &lt;td&gt;11.3&lt;/td&gt;
      &lt;td&gt;0.0&lt;/td&gt;
      &lt;td&gt;0%&lt;/td&gt;
      &lt;td&gt;0&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;29&lt;/td&gt;
      &lt;td&gt;11.5&lt;/td&gt;
      &lt;td&gt;0.0&lt;/td&gt;
      &lt;td&gt;0%&lt;/td&gt;
      &lt;td&gt;0&lt;/td&gt;
      &lt;td&gt;9&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;30&lt;/td&gt;
      &lt;td&gt;11.4&lt;/td&gt;
      &lt;td&gt;0.0&lt;/td&gt;
      &lt;td&gt;0%&lt;/td&gt;
      &lt;td&gt;0&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;31&lt;/td&gt;
      &lt;td&gt;11.2&lt;/td&gt;
      &lt;td&gt;0.0&lt;/td&gt;
      &lt;td&gt;0%&lt;/td&gt;
      &lt;td&gt;0&lt;/td&gt;
      &lt;td&gt;9&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;32&lt;/td&gt;
      &lt;td&gt;11.8&lt;/td&gt;
      &lt;td&gt;0.0&lt;/td&gt;
      &lt;td&gt;0%&lt;/td&gt;
      &lt;td&gt;0&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;91.4&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;50.3&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;28% mean&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;12&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;68&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Read the write column first. Eight links carrying 11.2 to 11.8 GiB/s, every one
at about half its 22.6 GiB/s ceiling. That is a healthy fabric, and it is why
nobody suspected the fabric: anyone who looked at ISL utilization during a write
test saw 50% and moved on.&lt;/p&gt;

&lt;p&gt;Now the read column. Five of eight cables carry nothing. Two carry 21.6 and 21.3
GiB/s, which is 96% and 94% of what an HDR link delivers as payload. Those two
are full. The mean across all eight is 28%, and 28% is what an aggregate fabric
graph shows, which is why an aggregate fabric graph cannot find this. The unit of
scarcity is a cable, and averaging over cables destroys the information you
need.&lt;/p&gt;

&lt;h3 id=&quot;the-row-that-makes-it-certain&quot;&gt;The row that makes it certain&lt;/h3&gt;

&lt;p&gt;Port 27 is the most useful row in the table. One client is routed over it, and it
reads at 7.4 GiB/s. In the write run twelve clients moved 91.4 GiB/s, or 7.62
GiB/s each. A client with an uncontended path therefore reads within 3% of what
it writes. There is nothing wrong with readahead, prefetch, the disks, the
servers or the client: a client that gets its own cable performs as designed.&lt;/p&gt;

&lt;p&gt;That row turns “the fabric is suspicious” into “the fabric is the constraint”,
and it lets you predict the aggregate rather than merely describe it. Build the
prediction only from quantities that did not come out of the read run itself,
or you are adding up the answer and calling it a forecast. Two of them qualify:
the per-link payload ceiling, established on idle hardware, and the per-client
rate from the write run.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;two ISLs at payload ceiling    2 × 22.6 = 45.2 GiB/s
one uncontended client (write-run rate) =  7.6 GiB/s
                              predicted   52.8 GiB/s
                               measured   50.3 GiB/s   (-4.8%)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Within 5%, from two numbers neither of which was measured during the read test,
with the shortfall in the direction you would expect — a shared link running a
little under its idle ceiling. That is a different class of evidence from a
plausible story. Adding the measured read column to 50.3 is arithmetic, not a
prediction, and it is worth keeping the two apart when someone challenges the
result.&lt;/p&gt;

&lt;h2 id=&quot;the-obvious-interpretation-and-why-it-is-wrong&quot;&gt;The obvious interpretation, and why it is wrong&lt;/h2&gt;

&lt;p&gt;Everyone seeing that table for the first time says the same thing: five cables
are dead, so five cables are broken, check the transceivers.&lt;/p&gt;

&lt;p&gt;They are not broken. Look one column left. In the write run those same five
cables carried 11.2 to 11.8 GiB/s each, indistinguishable from the two that
saturate on reads. The link is up, at 4X, at the right rate, with no errors:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ibqueryerrors -c
## Summary: 22 nodes checked, 56 ports checked, 0 ports have errors beyond threshold
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibqueryerrors&lt;/code&gt; with no target sweeps the fabric and prints only the ports that
have something wrong, which is the behavior you want here. Two of its flags read
backwards from the obvious guess, and both will cost you: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-s&lt;/code&gt; takes a list of
counters to &lt;strong&gt;suppress&lt;/strong&gt;, not to select, so naming the counters you care about is
the one way to guarantee you do not see them. And &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-k&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-K&lt;/code&gt; clear error and data
counters as they read — run those on a production fabric and you have silently
reset the baseline of whatever else monitors it, which is the same mistake the
counter-differencing section warns against. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-c&lt;/code&gt;, used above, suppresses the
common side-effect counters and clears nothing.&lt;/p&gt;

&lt;p&gt;A cable carries nothing on reads because &lt;strong&gt;no destination LID with read traffic
is mapped to it&lt;/strong&gt;, and a full share on writes because storage LIDs are. Same
cable, same hour, two different pictures depending on which way the bytes go.&lt;/p&gt;

&lt;p&gt;The second wrong interpretation is subtler and costs more. “No link is saturated,
therefore the fabric is not the bottleneck.” Sound when links are used uniformly;
useless here, because the reported statistic uses a denominator that includes
five cables the traffic cannot reach. The correct denominator is the capacity the
routing tables permit: 3 × 22.6 = 67.8 GiB/s, of which the run achieves 50.3.
Seventy-four percent of a hard ceiling with two of three links at 95% is a
saturated network.&lt;/p&gt;

&lt;h2 id=&quot;corroboration-without-a-disk-in-the-path&quot;&gt;Corroboration without a disk in the path&lt;/h2&gt;

&lt;p&gt;You now have a fabric-shaped explanation built entirely from fabric counters.
Before acting on it, prove the ceiling exists with the filesystem out of the
picture. If a pure RDMA test between the same endpoints, in the same direction,
with no block device in the path, lands near the filesystem’s number, the
bottleneck is at or below the network and no storage tuning will move it.&lt;/p&gt;

&lt;p&gt;Run RDMA writes &lt;em&gt;from&lt;/em&gt; the storage nodes &lt;em&gt;to&lt;/em&gt; the clients, so bytes travel in the
read direction. Start all pairs together; one pair at a time tells you nothing
about aggregate behavior.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# on each client (receiver), one server process per pair&lt;/span&gt;
ib_write_bw &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; mlx5_0 &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-q&lt;/span&gt; 4 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 1048576 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; 30 &lt;span class=&quot;nt&quot;&gt;--report_gbits&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 18515 &amp;amp;

&lt;span class=&quot;c&quot;&gt;# on each storage node (sender), one process per assigned client, with -p&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# matching that client&apos;s listener. Twelve pairs over eight senders means some&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# nodes run two; give each pair its own port or the second will fail to bind.&lt;/span&gt;
ib_write_bw &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; mlx5_0 &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-q&lt;/span&gt; 4 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 1048576 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; 30 &lt;span class=&quot;nt&quot;&gt;--report_gbits&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 18515 &amp;lt;client-ip&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; #bytes  #iterations   BW peak[Gb/sec]  BW average[Gb/sec]  MsgRate[Mpps]
 1048576    112367        32.10              31.42             0.003746
 1048576    112116        31.88              31.35             0.003737
 1048576    133324        38.04              37.28             0.004444
 ...
 1048576    227273        64.02              63.55             0.007576
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Twelve pairs, summed: &lt;strong&gt;51.0 GiB/s&lt;/strong&gt;. The filesystem read run gave 50.3 GiB/s.
The gap is 1.5%, and there is no disk, no metadata server, no page cache and no
filesystem client in the RDMA path.&lt;/p&gt;

&lt;p&gt;The per-pair spread corroborates the routing story more sharply than the total
does. The pairs fall into three groups rather than scattering: six at about 31.4
Gb/s, five at about 37.3 Gb/s, and one at 63.6 Gb/s. Those are the ISL ceilings
divided by the number of pairs sharing them — 21.6 GiB/s split six ways, 21.3
GiB/s split five ways, and port 27’s single client taking the cable to itself at
about 7.4 GiB/s. The grouping matches the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibroute&lt;/code&gt; counts exactly, in a tool that
knows nothing about the filesystem and was never told which clients share a cable.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MsgRate&lt;/code&gt; column is a free consistency check on the whole block, and worth
using. At 31.42 Gb/s with 1 MiB messages the rate is about 3,750 messages per
second, which perftest reports in Mpps as 0.00375. A message rate of several whole
Mpps next to a megabyte message size is arithmetically impossible — it would be
terabits — and seeing one means the run used a different &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-s&lt;/code&gt; than you think, or
the figure was pasted from somewhere without being read.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
  &lt;p&gt;This test is only corroboration if the pairing is the same. If you let the test
pick a different set of nodes, or a different number of them, you have changed
which LIDs are destinations and therefore which cables carry the traffic. A
network-only test on a different node list can easily come out fast and send you
back to the storage layer for another week.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-one-command-that-would-have-short-circuited-all-of-it&quot;&gt;The one command that would have short-circuited all of it&lt;/h2&gt;

&lt;p&gt;Everything above reconstructs something the switch will simply tell you.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibroute&lt;/code&gt; dumps a switch’s linear forwarding table: destination LID on the left,
output port on the right.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ibroute 2 | head -10
Unicast lids [0x0-0x2f] of switch Lid 2 guid 0x043f720300yyyyyy (SwitchB):
  Lid  Out   Destination
       Port     Info
0x0001 025 : (Switch portguid 0x043f720300xxxxxx: &apos;SwitchA&apos;)
0x0003 025 : (Channel Adapter portguid 0x...: &apos;client-a HCA-1&apos;)
0x0004 026 : (Channel Adapter portguid 0x...: &apos;client-b HCA-1&apos;)
0x0005 025 : (Channel Adapter portguid 0x...: &apos;client-c HCA-1&apos;)
0x0006 026 : (Channel Adapter portguid 0x...: &apos;client-d HCA-1&apos;)
0x0007 025 : (Channel Adapter portguid 0x...: &apos;client-e HCA-1&apos;)
0x0008 026 : (Channel Adapter portguid 0x...: &apos;client-f HCA-1&apos;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Count how many of your job’s LIDs land on each output port:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# $JOB_LIDS = path to a file holding the LIDs of the clients in the run,&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# one per line, in the same 0x%04x form ibroute prints (0x0003, not 3).&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ibroute &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;NR==FNR {want[$1]; next}
           FNR&amp;gt;3 &amp;amp;&amp;amp; ($1 in want) {c[$2]++}
           END {for (p in c) printf &quot;port %s: %d\n&quot;, p, c[p]}&apos;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$JOB_LIDS&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; - &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    | &lt;span class=&quot;nb&quot;&gt;sort
&lt;/span&gt;port 025: 6
port 026: 5
port 027: 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Match the LIDs as whole fields, not as substrings. An earlier version of this
used &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -Ff&lt;/code&gt; against the LID list with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;^&lt;/code&gt; prefixed to each line, which does
nothing useful: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-F&lt;/code&gt; makes the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;^&lt;/code&gt; a literal character to search for, so the
pattern matches no line at all and the pipeline reports an empty distribution —
a result indistinguishable, at a glance, from a fabric with no job traffic on it.
The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;awk&lt;/code&gt; form above compares field 1 for equality and has no such failure mode.&lt;/p&gt;

&lt;p&gt;Twelve clients, three of eight available cables, two of them holding eleven of
the twelve. That is the answer. It takes about four seconds and needs no
benchmark, no maintenance window and no counter arithmetic.&lt;/p&gt;

&lt;p&gt;The reason it is not the first thing anyone tries is structural. Parallel
filesystem tuning documentation is thorough about page pool sizing, block size,
prefetch depth and queue depths, and says essentially nothing about inter-switch
links or routing engines, because those belong to another vendor’s product and
another team’s runbook. A filesystem-shaped investigation follows a
filesystem-shaped checklist, and that checklist has no entry for “count how many
of your nodes are routed over the same cable”. The elimination order below exists
to add one.&lt;/p&gt;

&lt;h2 id=&quot;telling-this-apart-from-the-things-it-resembles&quot;&gt;Telling this apart from the things it resembles&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symptom shape&lt;/th&gt;
      &lt;th&gt;Likely cause&lt;/th&gt;
      &lt;th&gt;Command that distinguishes&lt;/th&gt;
      &lt;th&gt;What you see if it is this&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Both directions slow, ISLs even and well below ceiling&lt;/td&gt;
      &lt;td&gt;Not the fabric. Storage or client concurrency.&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iostat -x 5&lt;/code&gt; on servers; rerun with 2× the clients&lt;/td&gt;
      &lt;td&gt;Device utilization high, or throughput scales with client count&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;One direction slow, several ISLs at exactly zero&lt;/td&gt;
      &lt;td&gt;Static routing collapse&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibroute &amp;lt;sw-lid&amp;gt;&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Active destination LIDs concentrated on a few output ports&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;One direction slow, all ISLs loaded, all near ceiling&lt;/td&gt;
      &lt;td&gt;Genuinely out of ISL bandwidth&lt;/td&gt;
      &lt;td&gt;the perfquery table&lt;/td&gt;
      &lt;td&gt;Aggregate ≈ number of ISLs × per-link payload ceiling&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Slow and erratic, ISLs uneven but none at zero&lt;/td&gt;
      &lt;td&gt;A degraded link&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo \| grep -v &quot;4X.*53.125&quot;&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;One link at 1X, or negotiated to a lower rate&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Slow, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt; climbing, no link near ceiling&lt;/td&gt;
      &lt;td&gt;Credit starvation from a slow receiver downstream&lt;/td&gt;
      &lt;td&gt;plain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery &amp;lt;lid&amp;gt; &amp;lt;port&amp;gt;&lt;/code&gt; deltas on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt; (not in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-x&lt;/code&gt; set)&lt;/td&gt;
      &lt;td&gt;XmitWait rising on the ports that feed one endpoint&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Slow with rising error counters&lt;/td&gt;
      &lt;td&gt;Physical: cable, connector, transceiver&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibqueryerrors -c&lt;/code&gt;, twice, differenced&lt;/td&gt;
      &lt;td&gt;Non-zero deltas isolated to specific cables&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Slow for some jobs and not others&lt;/td&gt;
      &lt;td&gt;Allocation-dependent LID mapping&lt;/td&gt;
      &lt;td&gt;rerun on a different node list&lt;/td&gt;
      &lt;td&gt;The ISL distribution changes with the node list&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The last row causes the most confusion on a shared cluster. Once the mechanism is
clear it follows that the throughput a user gets depends on which nodes the
scheduler handed them, and that two runs of an identical job on identical
hardware can differ by a factor of two with nothing wrong anywhere. A benchmark
result quoted without its node list is not reproducible, and a regression that
comes and goes between runs may be the scheduler rather than the storage.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt; deserves a note. It counts ticks during which a port had data to
send and no credits to send it with, which makes it the best early indicator of
downstream congestion and also famously noisy. Difference it like the data
counters — but with plain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery&lt;/code&gt;, since it is a basic 32-bit counter and the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-x&lt;/code&gt; attribute does not carry it:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ perfquery 2 25 | grep PortXmitWait
PortXmitWait:....................18446231
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Non-zero XmitWait is normal on a busy fabric. Only the rate of change, on
specific ports, correlated with a specific workload, means anything. Do not raise
a ticket on an absolute value. The tick is a device-specific unit rather than a
fixed interval, so treat the counter as an ordering between ports on the same
switch and not as a duration you can convert to seconds.&lt;/p&gt;

&lt;h2 id=&quot;the-elimination-order&quot;&gt;The elimination order&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;#&lt;/th&gt;
      &lt;th&gt;Step&lt;/th&gt;
      &lt;th&gt;Command&lt;/th&gt;
      &lt;th&gt;Cost&lt;/th&gt;
      &lt;th&gt;Rules out&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;Confirm every ISL is at full width and rate&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iblinkinfo -S &amp;lt;switch-guid&amp;gt;&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;seconds&lt;/td&gt;
      &lt;td&gt;A degraded cable masquerading as a capacity shortfall&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;2&lt;/td&gt;
      &lt;td&gt;Count active job LIDs per ISL output port&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibroute -n &amp;lt;sw-lid&amp;gt;&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;seconds&lt;/td&gt;
      &lt;td&gt;Static routing collapse — or confirms it outright&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;3&lt;/td&gt;
      &lt;td&gt;Difference per-ISL counters under a write load&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;perfquery -x&lt;/code&gt;, two samples&lt;/td&gt;
      &lt;td&gt;2 minutes&lt;/td&gt;
      &lt;td&gt;Establishes the healthy-direction baseline&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;4&lt;/td&gt;
      &lt;td&gt;Repeat under an uncached read load&lt;/td&gt;
      &lt;td&gt;same&lt;/td&gt;
      &lt;td&gt;2 minutes&lt;/td&gt;
      &lt;td&gt;Produces the asymmetry table&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;5&lt;/td&gt;
      &lt;td&gt;Reproduce the ceiling with RDMA only, same pairing&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ib_write_bw&lt;/code&gt; fan&lt;/td&gt;
      &lt;td&gt;10 minutes&lt;/td&gt;
      &lt;td&gt;Everything above the network: filesystem, cache, disk&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;6&lt;/td&gt;
      &lt;td&gt;Check error and wait counters over the same window&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibqueryerrors&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PortXmitWait&lt;/code&gt; deltas&lt;/td&gt;
      &lt;td&gt;minutes&lt;/td&gt;
      &lt;td&gt;Physical faults and downstream credit starvation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;7&lt;/td&gt;
      &lt;td&gt;Only now, touch a filesystem tunable&lt;/td&gt;
      &lt;td&gt;—&lt;/td&gt;
      &lt;td&gt;hours to days&lt;/td&gt;
      &lt;td&gt;—&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Steps 1 and 2 take under a minute and answer the question on most fabrics.
Everything after them builds a case you can hand to someone else, which matters,
because the remedy usually needs a change to a subnet manager another team owns.&lt;/p&gt;

&lt;h2 id=&quot;what-you-can-actually-do-about-it&quot;&gt;What you can actually do about it&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Adaptive routing.&lt;/strong&gt; The real fix is to stop choosing the output port once per
destination and choose it per packet based on port load. On NVIDIA switches this
comes from the subnet manager, by selecting an AR-capable routing engine — the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ar_*&lt;/code&gt; family, such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ar_updn&lt;/code&gt;, alongside further &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ar_&lt;/code&gt; options that control the
mode and which service levels participate:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# opensm.conf — illustrative; take the exact directives from your own man page
routing_engine ar_updn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three caveats, and the third is the one that bites. These engines are NVIDIA
extensions shipped with their subnet manager rather than upstream OpenSM, so
whether you have them at all depends on which SM package you installed. Adaptive
routing can also deliver packets out of order, which reliable-connected queue
pairs do not enjoy, so the SM generally restricts it to adapters advertising
tolerance for it. And the option names, defaults and permitted values in this
family have moved between MLNX_OFED and DOCA-OFED releases — read them out of the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opensm&lt;/code&gt; man page and sample &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opensm.conf&lt;/code&gt; shipped with the package you actually
have, not out of an article, this one included.&lt;/p&gt;

&lt;p&gt;Then verify it took rather than assuming. NVIDIA’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;smparquery&lt;/code&gt; reads the
vendor-specific adaptive-routing MADs from a switch, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibdiagnet&lt;/code&gt; reports AR
state in its fabric summary; check invocation syntax against your installed
version, as it differs between tool generations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;More links to spread over.&lt;/strong&gt; Adding ISLs raises the ceiling without fixing the
mechanism. The distribution improves with the number of cables, but only up to
the number of active destinations, and only if the aliasing does not follow you.
The collapse can reappear at the next SM sweep with a different node allocation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Break the round-robin.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scatter_ports&lt;/code&gt; takes a seed and randomizes selection
among equally loaded ports instead of cycling. One line, no hardware implication,
attacks the aliasing directly — and it is a lottery, not a guarantee: you swap a
systematically bad distribution for a randomly chosen one, usually much better
and occasionally not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Route the important nodes first.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;guid_routing_order_file&lt;/code&gt; sets the order in
which port GUIDs are routed for Min Hop and Up/Down. Put the genuinely hot GUIDs
at the top and they take the clean round-robin before the rest of the subnet
consumes the balance. Targeted, deterministic and underused.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Change the engine.&lt;/strong&gt; On a genuine fat tree with all channel adapters at the
leaves, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftree&lt;/code&gt; routes with the topology in mind rather than counting LIDs. It
falls back rather than running on a topology it does not recognize, which is a
feature. Note that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftree&lt;/code&gt; does not support LMC greater than zero, and several of
the other engines carry restrictions of their own on LMC and on topology; check
the constraints for the specific engine and OpenSM version before planning
around one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Raise LMC, carefully.&lt;/strong&gt; Giving each port 2^LMC LIDs lets the engine compute
different paths to the same port. It helps only if the upper-layer protocol
issues path records for the alternate LIDs, which many do not, and the cost
multiplies across every port in the subnet and every forwarding table entry
needed to reach them. Establish that your client uses multiple paths first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check who runs the subnet manager.&lt;/strong&gt; Where the SM runs on a managed switch, the
embedded manager exposes only a subset of these options through the switch CLI,
and on some firmware levels routing engine selection is not in it. Moving the SM
to a host gives the full option set and a config file you can version. Find out
what you have before planning around it:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sminfo
sminfo: sm lid 1 sm guid 0x043f720300xxxxxx, activity count 74412 priority 14 state 3 SMINFO_MASTER
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sminfo&lt;/code&gt; reports the SM’s &lt;em&gt;port&lt;/em&gt; GUID, which for a switch’s management port is
normally the same value &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ibswitches&lt;/code&gt; prints as the node GUID. A match there means
the fabric is being managed from the switch rather than from a host.&lt;/p&gt;

&lt;h2 id=&quot;what-to-claim-afterwards&quot;&gt;What to claim afterwards&lt;/h2&gt;

&lt;p&gt;Be careful about the size of the claim. The evidence supports this: for this node
allocation, in the read direction, the achievable aggregate is bounded by three
inter-switch links, two of them at 95% of payload ceiling, and a network-only
test with no storage in the path reproduces the bound to within 2%. The measurements apply to that allocation and direction.&lt;/p&gt;

&lt;p&gt;It does not support “the storage is fine”. The storage was never tested above
50.3 GiB/s on reads because the network would not deliver more. When the routing
is fixed, expect a second ceiling behind the first. That is the ordinary shape of
performance work.&lt;/p&gt;

&lt;p&gt;It also does not support a general statement about the fabric. Change the node
list and the numbers change. Quote any figure with the node count, the direction,
the dataset size relative to cache, and the ISL distribution that produced it.
Without those four the number is not reproducible, and someone will eventually
try to reproduce it.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Vault and service accounts: rotation must reach the running application</title>
    <link href="https://www.wirewalk.com/writing/vault-service-account-lifecycle/"/>
    <published>2026-02-02T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/vault-service-account-lifecycle/</id>
    <summary>Secret issuance, application renewal, and credential revocation are separate steps to verify.</summary>
    <content type="html">&lt;p&gt;Credential rotation is unfinished if the application keeps using the old secret from a configuration file or connection pool. Test the consumer through a refresh, a restart and revocation, so the rotation procedure covers what the application actually does.&lt;/p&gt;

&lt;h2 id=&quot;start-with-one-service-identity&quot;&gt;Start with one service identity&lt;/h2&gt;

&lt;p&gt;Choose a noncritical application and record which database or API it accesses, the required privileges, how it receives credentials, and how it refreshes them. Separate deployment credentials from runtime credentials. A build system should not automatically inherit the application’s production data access.&lt;/p&gt;

&lt;p&gt;HashiCorp Vault’s &lt;a href=&quot;https://developer.hashicorp.com/vault/docs/secrets/databases&quot;&gt;database secrets engine&lt;/a&gt; documents dynamic credentials and database-specific integrations. Supported plugins and credential behavior vary, so use the exact database and plugin documentation before implementation.&lt;/p&gt;

&lt;h2 id=&quot;define-the-credential-contract&quot;&gt;Define the credential contract&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Property&lt;/th&gt;
      &lt;th&gt;Question&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Scope&lt;/td&gt;
      &lt;td&gt;Which operations and resources are allowed?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Lifetime&lt;/td&gt;
      &lt;td&gt;How long may a credential remain valid?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Renewal&lt;/td&gt;
      &lt;td&gt;Who renews it and what happens on failure?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Revocation&lt;/td&gt;
      &lt;td&gt;How does the backend actually invalidate it?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Recovery&lt;/td&gt;
      &lt;td&gt;How does the application restart if Vault is unavailable?&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The contract should also identify where credentials might be copied: environment variables, logs, crash dumps, temporary files, or deployment artifacts. Moving the original into Vault does not remove existing copies.&lt;/p&gt;

&lt;h2 id=&quot;test-the-consumer-lifecycle&quot;&gt;Test the consumer lifecycle&lt;/h2&gt;

&lt;p&gt;In a lab database, issue a least-privilege credential through the intended integration. Start the application, perform a permitted operation, and confirm that an out-of-scope operation is denied.&lt;/p&gt;

&lt;p&gt;Allow renewal or rotation to occur through the actual application workflow. Confirm new connections use valid credentials and that the application handles the transition without accumulating connection failures. Then test expiry or revocation on the disposable identity and observe both new and existing connections according to the database’s behavior.&lt;/p&gt;

&lt;p&gt;Do not assume a revoked lease instantly terminates every established session. Establish the backend-specific outcome and document any additional response step.&lt;/p&gt;

&lt;h2 id=&quot;protect-bootstrap-authority&quot;&gt;Protect bootstrap authority&lt;/h2&gt;

&lt;p&gt;The application needs an initial way to authenticate to Vault. Review that mechanism as carefully as the database credential. A permanent broad token embedded in an image can recreate the original problem at a more powerful layer.&lt;/p&gt;

&lt;p&gt;Prefer workload identity methods supported by the environment, scope policies tightly, and verify the audit trail. Avoid displaying live secret values in routine validation output.&lt;/p&gt;

&lt;h2 id=&quot;plan-for-service-loss&quot;&gt;Plan for service loss&lt;/h2&gt;

&lt;p&gt;Test a temporary loss of the secret-management path in a lab. Distinguish an already running application from a cold restart. Record the maximum acceptable interruption and the approved recovery path. Do not silently extend credentials indefinitely to make an availability test pass.&lt;/p&gt;

&lt;p&gt;Keep the permitted and denied operation results with the rotation, revocation and outage tests. They show how the Vault policy behaves in the running application and what an operator must do if the secret service is unavailable.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>GPU inference in streaming pipelines: Triton capacity, backpressure, and replay</title>
    <link href="https://www.wirewalk.com/writing/streaming-batch-watermarks-replay-correctness/"/>
    <published>2026-01-21T10:00:00-05:00</published>
    <updated>2026-01-21T10:00:00-05:00</updated>
    <id>https://www.wirewalk.com/writing/streaming-batch-watermarks-replay-correctness/</id>
    <summary>Integrate NVIDIA Triton scoring with batch and streaming systems using bounded GPU queues, microbatch latency budgets, versioned outputs, idempotent replay, and event-time correctness.</summary>
    <content type="html">&lt;p&gt;Fast individual inference calls can hide a growing queue. When events arrive faster than an NVIDIA inference service can process them, the pipeline falls behind; replaying a backlog through the same service adds more pressure.&lt;/p&gt;

&lt;p&gt;Budget event processing and GPU serving together. For a qualified Triton stage, define who owns event-time state, how results change when late data arrives and how much capacity replay and historical backfills may consume.&lt;/p&gt;

&lt;h2 id=&quot;allocate-the-latency-budget-across-the-whole-path&quot;&gt;Allocate the latency budget across the whole path&lt;/h2&gt;

&lt;p&gt;Break the deadline into source delay, stream scheduling, feature preparation, inference queueing, GPU execution, and output commit. A fast model kernel cannot satisfy an end-to-end deadline if a microbatch waits several seconds before it is submitted.&lt;/p&gt;

&lt;p&gt;For a stateless scoring model compatible with Triton’s dynamic batching, compare client microbatching against server batching. Do not stack delays without accounting for both. Bound outstanding requests and batch size, and measure output validity and tail latency over the actual input-size distribution.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://raw.githubusercontent.com/triton-inference-server/server/r24.04/docs/user_guide/optimization.md&quot;&gt;Triton 24.04 optimization guide&lt;/a&gt; explains batching and instance-count tradeoffs. The proposed stream design adds an application-level rule: admission and retry policies must keep in-flight work within the measured GPU capacity. Server batching is not the same as event-time windowing.&lt;/p&gt;

&lt;h2 id=&quot;make-replay-a-versioned-inference-workload&quot;&gt;Make replay a versioned inference workload&lt;/h2&gt;

&lt;p&gt;Attach the chosen model release to each processing batch or an explicitly defined event policy. On retry, preserve that choice when reproducibility requires the same model. Otherwise a replay after a deployment can silently produce different scores for the same historical input.&lt;/p&gt;

&lt;p&gt;Use stable event identifiers at the output sink. Triton returning a score does not atomically commit the stream offset and the destination write. Model serving does not supply exactly-once delivery for arbitrary downstream effects; the checkpoint, sink, and idempotency design must provide the required behavior.&lt;/p&gt;

&lt;p&gt;Reserve inference capacity or separate device allocations for backfills. A replay that saturates every GPU can prevent current events from meeting their deadline. Throttle it using measured headroom, and monitor oldest-event age alongside device activity.&lt;/p&gt;

&lt;p&gt;Keep the roles clear when considering RAPIDS: selected batch analytics operations may benefit from acceleration, but this article does not assume that installing the Spark accelerator makes an arbitrary stateful streaming query GPU-native. Validate the supported plan and release before making that platform commitment. The watermarks, late-data policy, and reconciliation rules below still determine what the result means.&lt;/p&gt;

&lt;h2 id=&quot;define-freshness-and-completeness-separately&quot;&gt;Define freshness and completeness separately&lt;/h2&gt;

&lt;p&gt;Freshness measures how quickly available data becomes visible. Completeness asks whether all relevant events have arrived and been incorporated. A result can be fresh and incomplete, or complete and delayed.&lt;/p&gt;

&lt;p&gt;For an illustrative hourly production dashboard, distinguish “events received in the last hour” from “events that occurred during that hour.” A device that uploads its morning measurements at noon changes the second result but not the first.&lt;/p&gt;

&lt;p&gt;State the allowed lateness, when results are provisional, when they become final, and how corrections are communicated. If the business requires historical revisions, the storage and consumer interfaces must support them.&lt;/p&gt;

&lt;h2 id=&quot;preserve-multiple-clocks&quot;&gt;Preserve multiple clocks&lt;/h2&gt;

&lt;p&gt;Event time is when the source says something happened. Ingestion time is when the platform received it. Processing time is when a particular stage handled it. Keep these values distinct where the use case needs them.&lt;/p&gt;

&lt;p&gt;Validate source clock quality. A malfunctioning device with a future timestamp can distort event-time progress if the design trusts it blindly. A source that changes time zones or sends ambiguous local timestamps needs normalization rules and error handling.&lt;/p&gt;

&lt;p&gt;Retain enough raw information to diagnose those decisions. Dropping the original timestamp and timezone after parsing makes later corrections much harder.&lt;/p&gt;

&lt;h2 id=&quot;use-watermarks-as-state-management-policies&quot;&gt;Use watermarks as state-management policies&lt;/h2&gt;

&lt;p&gt;A watermark helps an engine decide when event-time state can be retired or results advanced. It is not proof that no older event will ever arrive.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://raw.githubusercontent.com/apache/spark/v3.5.1/docs/structured-streaming-programming-guide.md&quot;&gt;Spark 3.5.1 Structured Streaming guide&lt;/a&gt; explains event-time windows, watermarks, and guarantees around late data. Behavior depends on the operator, output mode, and query structure. Avoid reducing those conditions to “all data later than the delay is always dropped” or “nothing is ever lost.”&lt;/p&gt;

&lt;p&gt;Choose the delay using observed lateness and business consequences. Longer retention can improve completeness but increases state and recovery cost. Measure state size, update rate, checkpoint duration, and the effect of idle or slow sources.&lt;/p&gt;

&lt;h2 id=&quot;give-every-side-effect-a-replay-policy&quot;&gt;Give every side effect a replay policy&lt;/h2&gt;

&lt;p&gt;A streaming engine may recover and replay input after failure. The destination must handle that replay correctly. A database upsert keyed by a stable event identifier differs from an unkeyed append or an external notification.&lt;/p&gt;

&lt;p&gt;Define event identity independently from delivery attempt identity. Deduplicating only on a transport offset may not remove an event that was published twice under different offsets. Deduplicating only on a payload hash may incorrectly collapse two legitimate identical measurements.&lt;/p&gt;

&lt;p&gt;For external effects, use an idempotency key or a durable outbox and a receiver that honors the intended contract. A successful checkpoint cannot make an arbitrary third-party action exactly once. Validate the behavior across the boundary between input progress, computation state, and destination commit.&lt;/p&gt;

&lt;h2 id=&quot;bound-deduplication-and-aggregation-state&quot;&gt;Bound deduplication and aggregation state&lt;/h2&gt;

&lt;p&gt;An unbounded stream can imply unbounded state if every identifier must be remembered forever. Choose retention based on the maximum relevant duplicate interval and correction policy, then document what happens outside it.&lt;/p&gt;

&lt;p&gt;Windowed aggregates need explicit keys and boundaries. Test events exactly on a boundary, negative or missing timestamps, duplicate arrivals, and records corrected after initial acceptance. Define how a retraction or replacement updates earlier aggregates.&lt;/p&gt;

&lt;p&gt;Watch state growth as a service metric. A query that processes every batch successfully while its state store grows without limit is accumulating an outage.&lt;/p&gt;

&lt;h2 id=&quot;treat-checkpoint-compatibility-as-an-interface&quot;&gt;Treat checkpoint compatibility as an interface&lt;/h2&gt;

&lt;p&gt;A checkpoint records progress and state for a particular query and implementation. Changing sources, stateful operators, schemas, or runtime versions can affect whether it is safe to resume.&lt;/p&gt;

&lt;p&gt;Test upgrades with a representative checkpoint in an isolated environment. Confirm both recovery and output equivalence for the intended change. Do not delete a production checkpoint as a routine fix without understanding whether the restart will replay input, lose state, or duplicate effects.&lt;/p&gt;

&lt;p&gt;Keep source retention long enough to support the recovery objective. A perfect checkpoint policy cannot replay events that the source has already expired when recovery requires them.&lt;/p&gt;

&lt;h2 id=&quot;design-backfills-as-first-class-operations&quot;&gt;Design backfills as first-class operations&lt;/h2&gt;

&lt;p&gt;Historical reprocessing competes with live traffic and may encounter different schemas or business rules. Give it an input snapshot, transformation version, output namespace, and resource budget.&lt;/p&gt;

&lt;p&gt;Write a backfill to a separate version or controlled staging destination, reconcile it, and publish it through a deliberate switch. Mixing a historical replay into the live destination without version or idempotency rules can double counts or overwrite newer corrections.&lt;/p&gt;

&lt;p&gt;Keep the logic shared where practical, but test equivalence rather than assuming shared code guarantees it. Streaming state, batch ordering, and late-event policies can create different results from the same transformations.&lt;/p&gt;

&lt;h2 id=&quot;reconcile-with-a-bounded-batch-reference&quot;&gt;Reconcile with a bounded batch reference&lt;/h2&gt;

&lt;p&gt;For selected closed intervals, recompute results from retained raw data and compare them with the streaming output. Account for the declared lateness policy, accepted corrections, deduplication horizon, and source completeness.&lt;/p&gt;

&lt;p&gt;Investigate discrepancies by event identity. Aggregate totals can match while the wrong records cancel each other. Use row-level comparisons for critical outputs and summarize differences by reason.&lt;/p&gt;

&lt;p&gt;A reconciliation job also needs an owner and alerting. A silent comparison that stopped running is not a continuing correctness control.&lt;/p&gt;

&lt;h2 id=&quot;choose-the-simplest-architecture-that-meets-the-deadline&quot;&gt;Choose the simplest architecture that meets the deadline&lt;/h2&gt;

&lt;p&gt;A scheduled incremental batch may meet a fifteen-minute requirement with less state and fewer recovery paths. A low-latency stream may be justified when a delayed decision loses value. Some systems need both a provisional stream and a reconciled batch view.&lt;/p&gt;

&lt;p&gt;Record the tradeoff: freshness target, completeness policy, replay horizon, state budget, and recovery procedure. Give downstream users a clear explanation of what each reported number includes, when late data may change it and how it can be reconstructed after failure.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Offboarding: disabling the directory account is one step</title>
    <link href="https://www.wirewalk.com/writing/offboarding-sessions-keys-tokens/"/>
    <published>2026-01-09T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/offboarding-sessions-keys-tokens/</id>
    <summary>Test existing sessions and independent credentials as well as new sign-ins.</summary>
    <content type="html">&lt;p&gt;Disabling a directory account may leave an existing application session, SSH key or API token usable. Follow a departure through each form of access, including credentials held by applications the person maintained.&lt;/p&gt;

&lt;h2 id=&quot;inventory-the-access-forms&quot;&gt;Inventory the access forms&lt;/h2&gt;

&lt;p&gt;Record the person’s interactive accounts, privileged identities, application roles, SSH credentials, API tokens, and delegated access. Include services they own so that access removal does not silently stop a business process.&lt;/p&gt;

&lt;p&gt;Do not record secret values in the inventory. Store credential identifiers, owning systems, scopes, and rotation procedures.&lt;/p&gt;

&lt;h2 id=&quot;separate-new-access-from-existing-access&quot;&gt;Separate new access from existing access&lt;/h2&gt;

&lt;p&gt;Microsoft documents that Entra token and application-session behavior can produce a delay between revocation and effective loss of access. Application-issued sessions may require application-side handling. See &lt;a href=&quot;https://learn.microsoft.com/en-us/entra/identity/users/users-revoke-access&quot;&gt;Microsoft’s access-revocation guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Use a test identity to establish what happens in your application estate:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Access form&lt;/th&gt;
      &lt;th&gt;Validation&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;New SSO login&lt;/td&gt;
      &lt;td&gt;Denied after the intended control takes effect&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Existing browser session&lt;/td&gt;
      &lt;td&gt;Ends within the documented interval/workflow&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;API token&lt;/td&gt;
      &lt;td&gt;Revoked or replaced at its issuing system&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;SSH key or certificate&lt;/td&gt;
      &lt;td&gt;No longer authorizes a new session&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Active server session&lt;/td&gt;
      &lt;td&gt;Handled by the approved session procedure&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A failed new login says nothing about a browser window already open elsewhere.&lt;/p&gt;

&lt;h2 id=&quot;handle-ssh-independently&quot;&gt;Handle SSH independently&lt;/h2&gt;

&lt;p&gt;Inspect central key or certificate issuance and local authorized-key paths. OpenSSH supports multiple authorization mechanisms, documented in &lt;a href=&quot;https://man.openbsd.org/sshd_config&quot;&gt;sshd_config&lt;/a&gt;. Removing one visible key file is incomplete if another source still grants access.&lt;/p&gt;

&lt;p&gt;A terminated employment relationship is not a reason to delete application data indiscriminately. Preserve records and transfer ownership according to the organization’s retention and business procedures. Keep operational ownership separate from the individual’s access rights.&lt;/p&gt;

&lt;h2 id=&quot;rehearse-a-full-departure&quot;&gt;Rehearse a full departure&lt;/h2&gt;

&lt;p&gt;Create a synthetic user with representative access and an active application session. Run the offboarding checklist in a test scope. Record each system’s completion time and the actual result of attempting access afterward.&lt;/p&gt;

&lt;p&gt;Include a long-lived credential issued outside SSO. This catches a common design gap: the central identity system does its job while an independent service continues to trust an older credential.&lt;/p&gt;

&lt;h2 id=&quot;make-exceptions-visible&quot;&gt;Make exceptions visible&lt;/h2&gt;

&lt;p&gt;Some departures require temporary continuity for scheduled tasks or shared business records. Replace personal ownership with an appropriate service identity or named successor. An exception should specify its purpose, expiry, and approving owner; leaving a personal account active indefinitely is not a migration strategy.&lt;/p&gt;

&lt;h2 id=&quot;acceptance-evidence&quot;&gt;Acceptance evidence&lt;/h2&gt;

&lt;p&gt;Keep the systems covered, access attempts, revocation timestamps, unresolved dependencies, and ownership transfers. Report incomplete items explicitly. If a token or session remains usable, record it as unfinished access removal even though the directory account is disabled.&lt;/p&gt;

&lt;p&gt;Review &lt;a href=&quot;/writing/vault-service-account-lifecycle/&quot;&gt;service-account lifecycle&lt;/a&gt; to reduce the number of workflows tied to personal credentials before the next departure.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Privileged SSH: make the bastion a real boundary</title>
    <link href="https://www.wirewalk.com/writing/privileged-ssh-bastion-boundaries/"/>
    <published>2025-12-16T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/privileged-ssh-bastion-boundaries/</id>
    <summary>A jump host is useful only when direct access, forwarding, and downstream authority are deliberately controlled.</summary>
    <content type="html">&lt;p&gt;After installing a bastion, try the old direct SSH route. If it still works from the same broad networks, administrators can bypass the new hop and its logging. Enforce the intended route on the managed hosts and the network, then test both routes.&lt;/p&gt;

&lt;h2 id=&quot;define-the-authorized-route&quot;&gt;Define the authorized route&lt;/h2&gt;

&lt;p&gt;Document which administrator devices can reach the bastion, which hosts it can reach, and which identities are accepted downstream. Separate ordinary user access from privileged maintenance. Keep a tested emergency route for recovery, with explicit ownership and audit.&lt;/p&gt;

&lt;p&gt;The boundary includes network policy and host authentication. Neither one substitutes for the other.&lt;/p&gt;

&lt;h2 id=&quot;inspect-effective-openssh-settings&quot;&gt;Inspect effective OpenSSH settings&lt;/h2&gt;

&lt;p&gt;OpenSSH documents configuration processing, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Match&lt;/code&gt; rules, forwarding controls, and authorized principals in &lt;a href=&quot;https://man.openbsd.org/sshd_config&quot;&gt;sshd_config&lt;/a&gt;. On a Linux lab server with an installed OpenSSH daemon:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;sshd &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;sshd &lt;span class=&quot;nt&quot;&gt;-T&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The first checks configuration validity; the second displays effective settings for the default context. Where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Match&lt;/code&gt; blocks are used, test the intended connection context with the version-supported &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-C&lt;/code&gt; options as well. Keep the output restricted because it reveals security configuration.&lt;/p&gt;

&lt;p&gt;Do not assume that the last line in a configuration file overrides earlier values. Includes and first-obtained-value behavior make visual inspection alone unreliable.&lt;/p&gt;

&lt;h2 id=&quot;test-the-access-matrix&quot;&gt;Test the access matrix&lt;/h2&gt;

&lt;p&gt;Use a pilot host and test four cases: approved administrator via bastion, unrelated user via bastion, direct connection from an ordinary client network, and the emergency path. Define the expected result for each.&lt;/p&gt;

&lt;p&gt;Test both authentication and privilege elevation. An account that can log in but cannot perform the approved task is an operational failure; an account that can become root everywhere may be broader than intended.&lt;/p&gt;

&lt;p&gt;If certificates are used, test expired and unauthorized principals with disposable credentials. Certificate issuance policy and signer protection become part of the access boundary.&lt;/p&gt;

&lt;h2 id=&quot;review-forwarding-and-sessions&quot;&gt;Review forwarding and sessions&lt;/h2&gt;

&lt;p&gt;Agent, TCP, and other forwarding features can extend authority beyond the apparent login route. Disable unnecessary features using the supported controls and test the workflows that remain. OpenSSH also notes that forwarding restrictions are not complete confinement for a user who can execute arbitrary code on the host.&lt;/p&gt;

&lt;p&gt;Record session start, identity, destination, and privileged actions according to the organization’s logging policy. Do not promise full command attribution merely because SSH authentication logs exist.&lt;/p&gt;

&lt;h2 id=&quot;roll-out-without-losing-recovery&quot;&gt;Roll out without losing recovery&lt;/h2&gt;

&lt;p&gt;Keep a working rescue session and independently verified console access during the pilot. Apply changes to a small group, establish a new session through the intended route, and verify both allowed and denied behavior before expanding.&lt;/p&gt;

&lt;p&gt;Check the route again from a fresh session before closing the rescue connection. Confirm that downstream privileges and emergency access still behave as intended. See &lt;a href=&quot;/writing/management-network-bmc-isolation/&quot;&gt;management-network isolation&lt;/a&gt; for the infrastructure beneath that route.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Microsoft Entra admin access: require the authentication method you intend</title>
    <link href="https://www.wirewalk.com/writing/entra-phishing-resistant-admin-access/"/>
    <published>2025-11-22T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/entra-phishing-resistant-admin-access/</id>
    <summary>An MFA requirement and a phishing-resistant authentication requirement are not identical policies.</summary>
    <content type="html">&lt;p&gt;An administrator may pass an MFA check using a method the organization did not intend to allow. If phishing resistance is the requirement, specify the acceptable authentication strength and test that weaker fallback methods are rejected.&lt;/p&gt;

&lt;h2 id=&quot;inspect-authentication-strength&quot;&gt;Inspect authentication strength&lt;/h2&gt;

&lt;p&gt;Microsoft Entra Conditional Access provides authentication strengths that constrain acceptable method combinations. Microsoft documents a policy for administrator roles using phishing-resistant MFA. See &lt;a href=&quot;https://learn.microsoft.com/en-us/entra/identity/conditional-access/policy-admin-phish-resistant-mfa&quot;&gt;the administrator policy guide&lt;/a&gt; and &lt;a href=&quot;https://learn.microsoft.com/en-us/entra/identity/authentication/concept-authentication-strength-how-it-works&quot;&gt;how strengths are evaluated&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Confirm current licensing, supported methods, tenant configuration, and dependencies before rollout. Do not assume a policy named “strong MFA” actually requires the intended methods.&lt;/p&gt;

&lt;h2 id=&quot;prepare-registration-and-recovery&quot;&gt;Prepare registration and recovery&lt;/h2&gt;

&lt;p&gt;Select a pilot group and ensure users have registered the approved authenticators before enforcement. Test an alternative recovery route that does not recreate the same failure dependency. Losing a device should not leave the only administrator unable to operate the tenant.&lt;/p&gt;

&lt;p&gt;Microsoft’s &lt;a href=&quot;https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/security-emergency-access&quot;&gt;emergency access guidance&lt;/a&gt; is the starting point for protecting and monitoring emergency accounts. Follow current requirements rather than copying an old blanket MFA exclusion.&lt;/p&gt;

&lt;h2 id=&quot;test-a-policy-matrix&quot;&gt;Test a policy matrix&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Scenario&lt;/th&gt;
      &lt;th&gt;Expected result&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Pilot administrator with approved method&lt;/td&gt;
      &lt;td&gt;Access succeeds&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Pilot administrator using a disallowed method&lt;/td&gt;
      &lt;td&gt;Required step-up or denial&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Unregistered pilot administrator&lt;/td&gt;
      &lt;td&gt;Documented enrollment/recovery outcome&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Emergency procedure&lt;/td&gt;
      &lt;td&gt;Authorized access and visible audit evidence&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Ordinary user outside scope&lt;/td&gt;
      &lt;td&gt;Intended existing behavior&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Run report-only analysis where supported, then a controlled enforced pilot. Report-only results cannot establish that an application actually accepts the final login flow.&lt;/p&gt;

&lt;h2 id=&quot;review-exclusions-as-carefully-as-inclusions&quot;&gt;Review exclusions as carefully as inclusions&lt;/h2&gt;

&lt;p&gt;List excluded users, groups, workloads, and applications. Give each exception an owner and review date. A broad exclusion for automation may accidentally cover interactive administrators if account types and group membership are poorly controlled.&lt;/p&gt;

&lt;p&gt;Check the interaction with other Conditional Access policies. The effective result comes from the policy set, not the one screen currently being reviewed. Inspect sign-in details for the test session to confirm which controls applied.&lt;/p&gt;

&lt;h2 id=&quot;protect-the-post-login-path&quot;&gt;Protect the post-login path&lt;/h2&gt;

&lt;p&gt;Stronger authentication does not remove excessive privileges, insecure administrator workstations, or stolen active sessions. Keep privileged work separate from ordinary browsing and email, minimize standing authority, and document session-revocation procedures.&lt;/p&gt;

&lt;p&gt;Keep sign-in evidence for allowed and denied attempts, together with the policy scope, exclusions and recovery test. Enrollment counts will not show whether the policy actually blocked a weaker method.&lt;/p&gt;

&lt;p&gt;Next, examine &lt;a href=&quot;/writing/privileged-ssh-bastion-boundaries/&quot;&gt;privileged SSH access&lt;/a&gt; and &lt;a href=&quot;/writing/offboarding-sessions-keys-tokens/&quot;&gt;offboarding across sessions and tokens&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Scaling NVIDIA GPU analytics: RAPIDS, shuffle, and straggler diagnosis</title>
    <link href="https://www.wirewalk.com/writing/parallel-data-analysis-skew-shuffle/"/>
    <published>2025-11-12T10:00:00-05:00</published>
    <updated>2025-11-12T10:00:00-05:00</updated>
    <id>https://www.wirewalk.com/writing/parallel-data-analysis-skew-shuffle/</id>
    <summary>Diagnose parallel GPU analysis through Spark plans, RAPIDS task concurrency, host and device spill, shuffle traffic, Nsight traces, and controlled scaling with verified output equivalence.</summary>
    <content type="html">&lt;p&gt;Most tasks finish, but a few oversized partitions keep the analytics job running. Adding NVIDIA GPUs will not split a hot key or repair a join that multiplied the data. Follow the slow stage through GPU memory, host memory, storage and network before buying more capacity.&lt;/p&gt;

&lt;p&gt;The partition distribution should guide the next experiment: a query rewrite, a concurrency change, more memory or a fabric improvement. Keep a correct CPU or existing distributed result available to check every candidate.&lt;/p&gt;

&lt;h2 id=&quot;separate-the-spark-plan-from-the-gpu-execution-path&quot;&gt;Separate the Spark plan from the GPU execution path&lt;/h2&gt;

&lt;p&gt;With RAPIDS Accelerator, inspect the executed plan to identify accelerated operators and CPU transitions. A cluster containing GPUs is not evidence that a particular query used them effectively. Unsupported or unsuitable parts of a plan can retain CPU and transfer costs even when some stages accelerate.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.nvidia.com/spark-rapids/user-guide/24.04/tuning-guide.html&quot;&gt;RAPIDS 24.04 tuning guide&lt;/a&gt; distinguishes concurrent executor tasks from tasks actively sharing the GPU. For an investigation, vary those controls independently within a safe memory budget. Increasing CPU-side concurrency may improve input preparation or may multiply buffered data and spill; the task timeline should show which happened.&lt;/p&gt;

&lt;p&gt;Keep one executor mapped to one GPU for that documented release. Record the executor’s host-memory budget and overhead as well as device memory. A GPU out-of-memory incident and a killed JVM are different failures and need different evidence.&lt;/p&gt;

&lt;h2 id=&quot;attribute-the-tail-across-device-host-and-fabric&quot;&gt;Attribute the tail across device, host, and fabric&lt;/h2&gt;

&lt;p&gt;For the slowest partitions, collect input rows and bytes, shuffle read and write, device spill, host spill, local-disk activity, and retries. A hot partition can saturate its assigned GPU while the rest of the cluster appears idle. A transport-limited stage can instead leave every GPU waiting.&lt;/p&gt;

&lt;p&gt;Use a short &lt;a href=&quot;https://docs.nvidia.com/nsight-systems/2024.2/UserGuide/index.html&quot;&gt;Nsight Systems 2024.2&lt;/a&gt; capture when the application and access policy permit it. Correlate kernel activity and transfers with stage boundaries rather than collecting a long trace with no hypothesis. Rerun timing without profiling to check the observer’s overhead.&lt;/p&gt;

&lt;p&gt;A ConnectX-equipped fabric can be part of the design, but do not assume a Spark shuffle uses GPUDirect RDMA because the hardware supports it. Establish the plugin, transport, and release-specific configuration actually in use. Measure relevant network traffic and compare the executed path before crediting a fabric feature with a speedup.&lt;/p&gt;

&lt;p&gt;The skew and join transformations below should be accepted only after output comparison. Faster movement of an accidentally multiplied join result is an infrastructure expense, not a successful analysis.&lt;/p&gt;

&lt;h2 id=&quot;establish-a-correct-reference-result&quot;&gt;Establish a correct reference result&lt;/h2&gt;

&lt;p&gt;Before optimizing, preserve an input snapshot and an accepted output. For a dataset too large for complete row-by-row comparison, define meaningful invariants: distinct keys, row counts, null counts, sums, group totals, and selected exact outputs. Use stronger comparison where approximate checks could miss consequential errors.&lt;/p&gt;

&lt;p&gt;For floating-point reductions, decide whether equivalence means bitwise equality or agreement within a justified tolerance. Changing reduction order can change low-order bits without changing the intended numerical conclusion. Conversely, a wide tolerance can hide real data loss.&lt;/p&gt;

&lt;p&gt;Keep input versions and query code fixed during performance comparisons. A faster run against fewer records is not evidence of a better execution plan.&lt;/p&gt;

&lt;h2 id=&quot;decompose-the-elapsed-time&quot;&gt;Decompose the elapsed time&lt;/h2&gt;

&lt;p&gt;Separate startup, source discovery, scanning, parsing, local transformation, shuffle, aggregation, output writing, and commit or publication. Capture stage-level timing and task distributions, not only job duration.&lt;/p&gt;

&lt;p&gt;The original &lt;a href=&quot;https://www.usenix.org/conference/osdi-04/mapreduce-simplified-data-processing-large-clusters&quot;&gt;MapReduce paper from 2004&lt;/a&gt; describes a map and reduce execution model for large datasets. Its enduring diagnostic lesson for this discussion is that data movement and partitioned work are visible parts of the computation. The investigation sequence here is a proposed operating method.&lt;/p&gt;

&lt;p&gt;Measure wall time alongside CPU time, bytes read, bytes shuffled, spill, and failures. A task using little CPU may be blocked on input, memory pressure, or another dependency. High CPU can mean useful computation or repeated serialization.&lt;/p&gt;

&lt;h2 id=&quot;find-the-long-tail&quot;&gt;Find the long tail&lt;/h2&gt;

&lt;p&gt;Compare median, upper-percentile, and maximum task durations. Inspect the slowest tasks for input bytes, record counts, key distributions, garbage collection, spill, and retries.&lt;/p&gt;

&lt;p&gt;A few slow tasks can indicate skew: a popular key, a single exceptionally large record, or one partition containing a disproportionate share of the data. Uniform task sizes with uniformly poor performance suggest a broader bottleneck. Tasks that become slow on one specific host suggest an infrastructure issue rather than a global query problem.&lt;/p&gt;

&lt;p&gt;Do not average away the evidence. If one partition contains half the records, adding workers does not split that partition unless the execution plan or data organization changes.&lt;/p&gt;

&lt;h2 id=&quot;check-join-cardinality-before-tuning-the-transport&quot;&gt;Check join cardinality before tuning the transport&lt;/h2&gt;

&lt;p&gt;Verify uniqueness assumptions on both sides of every important join. If one key appears m times on one side and n times on the other, that key can produce m times n joined rows. Unexpected duplicates can create a huge intermediate result while every network counter behaves normally.&lt;/p&gt;

&lt;p&gt;Record row counts before and after the join. Inspect the largest key groups and compare against the intended relationship. A many-to-many result may be valid, but its cost should be deliberate.&lt;/p&gt;

&lt;p&gt;Filter early where semantics permit and project away unused columns before a wide shuffle. Preaggregate only when it preserves the result. For example, combining partial sums is straightforward; combining partial averages requires carrying counts as well as sums.&lt;/p&gt;

&lt;h2 id=&quot;treat-skew-with-a-specific-transformation&quot;&gt;Treat skew with a specific transformation&lt;/h2&gt;

&lt;p&gt;For a hot aggregation key, a two-stage reduction may help: distribute records across temporary subkeys, compute partial results, then combine by the original key. The combining function must be valid for the aggregate. Exact distinct counts and nonassociative operations need more care than sums.&lt;/p&gt;

&lt;p&gt;For a skewed join, salting a key can redistribute one side while replicating the matching records from the other side. That replication has a cost and must preserve match multiplicity. Validate null semantics, duplicate behavior, and the treatment of keys that are not skewed.&lt;/p&gt;

&lt;p&gt;A broadcast join can avoid a large shuffle when one side is genuinely small enough for the workers’ memory and the engine supports the required join semantics. Measure the in-memory representation and concurrent workloads; compressed file size is an unsafe memory estimate.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://raw.githubusercontent.com/apache/spark/v3.5.1/docs/sql-performance-tuning.md&quot;&gt;Spark 3.5.1 tuning reference&lt;/a&gt; documents adaptive execution and skew handling. Inspect the executed plan to see whether the expected optimization actually occurred.&lt;/p&gt;

&lt;h2 id=&quot;understand-memory-and-spill&quot;&gt;Understand memory and spill&lt;/h2&gt;

&lt;p&gt;A partition may fit on disk and still exceed the memory available for sorting, hashing, decoded columns, and runtime overhead. Spill can be a normal safety mechanism, but repeated spill and reread can dominate execution.&lt;/p&gt;

&lt;p&gt;Check per-worker concurrency. Giving an executor many simultaneous tasks also divides its practical memory budget among those tasks. Increasing task concurrency can make every task slower if they compete for the same memory and local storage.&lt;/p&gt;

&lt;p&gt;Measure local scratch capacity and throughput, and ensure temporary data has an appropriate lifecycle. A retry storm caused by exhausted scratch can resemble a distributed scheduling problem while its root cause is local storage pressure.&lt;/p&gt;

&lt;h2 id=&quot;scale-with-a-fixed-question&quot;&gt;Scale with a fixed question&lt;/h2&gt;

&lt;p&gt;For strong scaling, hold the dataset and computation fixed while changing resources. Record speedup and resource efficiency. For weak scaling, increase work with resources and report whether time remains stable. Do not mix the two interpretations.&lt;/p&gt;

&lt;p&gt;An illustrative job has twenty minutes of parallel work and five minutes that cannot be parallelized. Doubling workers can at best reduce the parallel portion to ten minutes under ideal conditions, giving fifteen minutes overall rather than twelve and a half. Real communication and scheduling costs can reduce the gain further.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.usenix.org/conference/hotcloud-10/spark-cluster-computing-working-sets&quot;&gt;2010 Spark paper&lt;/a&gt; introduced an approach to reusing working sets across parallel operations. Reuse can matter, but caching every intermediate is not a universal optimization: measure reuse, eviction, and recomputation cost.&lt;/p&gt;

&lt;h2 id=&quot;publish-the-optimization-with-its-correctness-evidence&quot;&gt;Publish the optimization with its correctness evidence&lt;/h2&gt;

&lt;p&gt;For every accepted change, preserve the original and revised plans, stage distributions, resource configuration, elapsed time, and output comparison. Repeat enough runs to distinguish the effect from cache and load variation, while stating which cache state each run represents.&lt;/p&gt;

&lt;p&gt;If the revised plan returns the same result faster across repeat runs, keep it with the measurements. If more workers leave the same tail of slow tasks, return to the partition and join evidence before scaling again.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Missing security telemetry: monitor the silence as well as the alerts</title>
    <link href="https://www.wirewalk.com/writing/missing-security-telemetry-prometheus/"/>
    <published>2025-10-29T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/missing-security-telemetry-prometheus/</id>
    <summary>A quiet dashboard can mean no incidents, a broken producer, or a source that vanished from inventory.</summary>
    <content type="html">&lt;p&gt;What should happen when a security sensor goes quiet? A failed target, a reachable collector receiving stale data and a source missing from discovery need different checks. Keep an independent inventory of expected sources so one disappearing from the dashboard still raises attention.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-three-failure-states&quot;&gt;Distinguish three failure states&lt;/h2&gt;

&lt;p&gt;A known target can be down. A known target can be reachable but stale. A target can be missing from discovery entirely. One uptime graph does not cover all three.&lt;/p&gt;

&lt;p&gt;Use an inventory of required sensors and log producers. Include ownership, expected event cadence, and maintenance rules. Compare observed sources against that inventory rather than deriving the entire expectation from whatever happened to report today.&lt;/p&gt;

&lt;h2 id=&quot;express-freshness-explicitly&quot;&gt;Express freshness explicitly&lt;/h2&gt;

&lt;p&gt;Prometheus documents &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;absent_over_time&lt;/code&gt; and time functions in its &lt;a href=&quot;https://prometheus.io/docs/prometheus/latest/querying/functions/&quot;&gt;query reference&lt;/a&gt;. For an exporter that you implement to publish the most recent event time, illustrative expressions are:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-promql&quot;&gt;(time() - security_last_event_timestamp_seconds{source=&quot;storage-audit&quot;}) &amp;gt; 900
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code class=&quot;language-promql&quot;&gt;absent_over_time(security_last_event_timestamp_seconds{source=&quot;storage-audit&quot;}[15m])
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;security_last_event_timestamp_seconds&lt;/code&gt; is an example metric, not a built-in metric supplied by a storage vendor or Prometheus. The first expression detects old values; the second detects no samples for the explicitly named source. Neither automatically enumerates every missing source in a changing fleet.&lt;/p&gt;

&lt;p&gt;The 15-minute window is illustrative. Select the threshold from the system’s real event behavior and response requirement. A genuinely idle source needs a heartbeat or controlled validation event rather than an assumption that user activity is continuous.&lt;/p&gt;

&lt;h2 id=&quot;test-the-alert-chain&quot;&gt;Test the alert chain&lt;/h2&gt;

&lt;p&gt;In a lab, stop the event producer while leaving the exporter running. Confirm the stale-event alert. Then stop the exporter and confirm missing-sample or target-down behavior. Finally remove the source from discovery and verify that inventory reconciliation still identifies it.&lt;/p&gt;

&lt;p&gt;These tests isolate different failure modes. If the third condition becomes invisible, the monitor still has an absence problem.&lt;/p&gt;

&lt;h2 id=&quot;carry-enough-context-to-act&quot;&gt;Carry enough context to act&lt;/h2&gt;

&lt;p&gt;An alert should name the producer, last event time, last successful collection, owning team, and a short diagnostic procedure. A generic “no data” notification encourages responders to guess whether the event source, network, parser, or query failed.&lt;/p&gt;

&lt;p&gt;Preserve maintenance windows with expiry. A permanent silence created for a temporary outage can make the monitoring system look healthy for months.&lt;/p&gt;

&lt;h2 id=&quot;check-timestamps-and-delivery&quot;&gt;Check timestamps and delivery&lt;/h2&gt;

&lt;p&gt;Clock skew can make a producer appear fresh or stale incorrectly. Compare event time with ingest time and monitor clock synchronization independently. Confirm that alert routing reaches a staffed destination using an approved test notification workflow.&lt;/p&gt;

&lt;p&gt;Test the response to each failure: a missing source, stale data and an unavailable target. Keep the expected-source inventory independent of the systems it is checking. Apply the same approach to &lt;a href=&quot;/writing/storage-audit-evidence-pipeline/&quot;&gt;storage audit pipelines&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Detection engineering: keep a test that must match and one that must not</title>
    <link href="https://www.wirewalk.com/writing/detection-rules-regression-tests/"/>
    <published>2025-10-05T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/detection-rules-regression-tests/</id>
    <summary>A small fixture library makes rule changes reviewable and keeps false-positive fixes from silently removing coverage.</summary>
    <content type="html">&lt;p&gt;Before releasing a detection rule, try a legitimate transaction that resembles the suspicious one. The rule needs to catch its target and leave that transaction alone. Keeping both examples makes the next false-positive fix much easier to assess.&lt;/p&gt;

&lt;h2 id=&quot;write-the-detection-contract&quot;&gt;Write the detection contract&lt;/h2&gt;

&lt;p&gt;For each rule, record the behavior, required telemetry, expected event fields, and the response owner. Describe the scope narrowly enough to test. “Detect suspicious traffic” is not a specification. “Alert on this synthetic request pattern in this inspected HTTP path” is.&lt;/p&gt;

&lt;p&gt;Keep one approved matching fixture, one ordinary nonmatching fixture, and any fixture added after a false positive. Use synthetic captures or appropriately sanitized authorized data. Store hashes and provenance so later reviewers know exactly what was exercised.&lt;/p&gt;

&lt;h2 id=&quot;use-the-engines-parser&quot;&gt;Use the engine’s parser&lt;/h2&gt;

&lt;p&gt;Suricata and Snort have documented configuration tests and offline capture modes. See &lt;a href=&quot;https://docs.suricata.io/en/suricata-7.0.8/command-line-options.html&quot;&gt;Suricata’s CLI reference&lt;/a&gt; and &lt;a href=&quot;https://docs.snort.org/start/inspection&quot;&gt;Snort’s traffic inspection guide&lt;/a&gt;. Validate the complete configuration used for the test, not just a detached rule string.&lt;/p&gt;

&lt;p&gt;The test record should contain:&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rule_id: locally assigned identifier
engine_version: exact installed version
configuration_hash: recorded SHA-256
fixture_hash: recorded SHA-256
expected: alert present or alert absent
observed: matching identifiers and count
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is a schema example, not measured output. Record the actual values from the run.&lt;/p&gt;

&lt;h2 id=&quot;assert-the-right-event&quot;&gt;Assert the right event&lt;/h2&gt;

&lt;p&gt;Do not accept “one or more alerts” as proof. Assert the intended rule identifier and, when relevant, the source, destination, or application field. A completely unrelated signature can otherwise make a broken test look successful.&lt;/p&gt;

&lt;p&gt;For suppression and threshold rules, define the expected count or range explicitly. Replay timing matters: an accelerated fixture may not behave like the original traffic window. Record the timing method and engine options.&lt;/p&gt;

&lt;h2 id=&quot;separate-detection-from-delivery&quot;&gt;Separate detection from delivery&lt;/h2&gt;

&lt;p&gt;An offline fixture proves engine behavior. A live benign event proves the collection and routing path. A ticket or notification received by the intended responder proves delivery. Maintain all three where the control depends on all three.&lt;/p&gt;

&lt;p&gt;If the product is deployed inline, add an observed client transaction result. A drop action in a file does not prove the forwarding path enforced it.&lt;/p&gt;

&lt;h2 id=&quot;make-exceptions-testable&quot;&gt;Make exceptions testable&lt;/h2&gt;

&lt;p&gt;When narrowing a rule to fix a false positive, add that legitimate example to the fixture library before changing the rule. Rerun both the old match and the new nonmatch. An exception should identify its owner, scope, and review date rather than becoming an undocumented global bypass.&lt;/p&gt;

&lt;p&gt;Keep fixture size modest and access controlled. Packet captures can contain credentials and personal data even when the original investigation seemed routine.&lt;/p&gt;

&lt;h2 id=&quot;what-to-release&quot;&gt;What to release&lt;/h2&gt;

&lt;p&gt;Release the rule, its tests, configuration changes, and results together. Keep the previous working version available for rollback. The next maintainer can then see which behavior changed and rerun the cases before enabling the rules.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Encrypted traffic: decide what each security sensor can actually establish</title>
    <link href="https://www.wirewalk.com/writing/encrypted-traffic-detection-boundaries/"/>
    <published>2025-09-11T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/encrypted-traffic-detection-boundaries/</id>
    <summary>Combine network, endpoint, and application evidence instead of assuming one sensor sees inside every connection.</summary>
    <content type="html">&lt;p&gt;Encryption leaves a network sensor with a different set of clues. Flows and handshake details may still help, while the application content remains unreadable. Plan the investigation around what each sensor can actually observe, and use endpoint or application logs for the questions it cannot answer.&lt;/p&gt;

&lt;h2 id=&quot;build-a-visibility-table&quot;&gt;Build a visibility table&lt;/h2&gt;

&lt;p&gt;For each important service, record where encryption starts and ends, which network paths are observed, and which endpoint or application logs are available.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Evidence source&lt;/th&gt;
      &lt;th&gt;Useful question&lt;/th&gt;
      &lt;th&gt;Important limit&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Network flow&lt;/td&gt;
      &lt;td&gt;Which endpoints communicated?&lt;/td&gt;
      &lt;td&gt;Usually no application payload&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;TLS metadata&lt;/td&gt;
      &lt;td&gt;What handshake details were observed?&lt;/td&gt;
      &lt;td&gt;Fields vary by protocol and privacy features&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Endpoint telemetry&lt;/td&gt;
      &lt;td&gt;Which process opened the connection?&lt;/td&gt;
      &lt;td&gt;Depends on agent coverage and trust&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Application audit&lt;/td&gt;
      &lt;td&gt;Which authenticated operation occurred?&lt;/td&gt;
      &lt;td&gt;Depends on application logging&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Zeek’s &lt;a href=&quot;https://docs.zeek.org/en/current/reference/logs/ssl.html&quot;&gt;TLS log documentation&lt;/a&gt; describes protocol metadata that may be available. Do not assume every connection exposes a hostname or certificate in the same way.&lt;/p&gt;

&lt;h2 id=&quot;test-two-observation-points&quot;&gt;Test two observation points&lt;/h2&gt;

&lt;p&gt;Use a lab application with a known request and a unique harmless marker. Observe the client-to-service encrypted path, then inspect authorized server-side application logs. Identify which source can establish the marker and which can establish only the connection.&lt;/p&gt;

&lt;p&gt;If there is an approved TLS termination proxy, document both sides. A sensor after termination may see plaintext traffic for that segment while missing traffic that takes a different route. The presence of a proxy does not establish universal inspection.&lt;/p&gt;

&lt;p&gt;Suricata’s &lt;a href=&quot;https://docs.suricata.io/en/suricata-7.0.8/rules/http-keywords.html&quot;&gt;HTTP keyword documentation&lt;/a&gt; describes application buffers used by HTTP rules. A payload rule requiring those buffers cannot be assumed to match opaque encrypted contents.&lt;/p&gt;

&lt;h2 id=&quot;evaluate-decryption-as-an-architecture-change&quot;&gt;Evaluate decryption as an architecture change&lt;/h2&gt;

&lt;p&gt;TLS inspection introduces certificate trust, private-key protection, application compatibility, and privacy obligations. Establish which traffic classes may be inspected and how the inspection infrastructure is administered. Test certificate-pinned applications and machine-to-machine clients before a rollout.&lt;/p&gt;

&lt;p&gt;Do not make “decrypt everything” a substitute for identifying business requirements. Some flows may be better covered by endpoint detection and application audit, especially where interception changes the trust model or breaks the workload.&lt;/p&gt;

&lt;h2 id=&quot;correlate-without-overstating-certainty&quot;&gt;Correlate without overstating certainty&lt;/h2&gt;

&lt;p&gt;Join network and endpoint records using time, addresses, ports, and host identity. Account for NAT and address reuse. A shared egress address can represent many users; it is not a user identifier.&lt;/p&gt;

&lt;p&gt;In an analyst exercise, write each conclusion beside its evidence source. “Host A connected to service B” may be established. “User C downloaded file D” may require application audit. Keeping that distinction visible prevents a plausible story from becoming an unsupported incident finding.&lt;/p&gt;

&lt;h2 id=&quot;verify-the-blind-spots&quot;&gt;Verify the blind spots&lt;/h2&gt;

&lt;p&gt;Repeat the fixture when routing, TLS termination, or endpoint tooling changes. Retain a list of unobserved paths and assign owners. Give investigators that list before an incident, so they know where to look when the network trace cannot answer a question.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Feeding GPU analytics: Parquet layout and NVIDIA RAPIDS infrastructure</title>
    <link href="https://www.wirewalk.com/writing/big-data-partitioning-columnar-small-files/"/>
    <published>2025-08-27T10:00:00-04:00</published>
    <updated>2025-08-27T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/big-data-partitioning-columnar-small-files/</id>
    <summary>Design storage and node resources for NVIDIA RAPIDS analytics, connecting Parquet layout, small-file overhead, GPU executor placement, host memory, transfer cost, and spill behavior.</summary>
    <content type="html">&lt;p&gt;A query running on NVIDIA GPUs can still spend most of its time finding files, decoding on CPUs or shuffling data. Before sizing another GPU node, inspect the plan and find out how quickly the storage layout supplies work to the accelerators.&lt;/p&gt;

&lt;p&gt;Evaluate the RAPIDS Accelerator for Apache Spark where its supported path matches the query. Compare elapsed time, resource cost and result correctness, including stages that remain on the CPU.&lt;/p&gt;

&lt;h2 id=&quot;design-a-balanced-gpu-analytics-node&quot;&gt;Design a balanced GPU analytics node&lt;/h2&gt;

&lt;p&gt;Budget CPU cores for parsing, scheduling, networking, and work that remains outside accelerated operators. Budget host RAM for the JVM, off-heap data, pinned transfer buffers, and spill. Add GPU memory and local scratch as separate capacity pools; compressed Parquet bytes are not an estimate of decoded device memory.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.nvidia.com/spark-rapids/user-guide/24.04/tuning-guide.html&quot;&gt;RAPIDS Accelerator 24.04 tuning guide&lt;/a&gt; specifies one executor per GPU for that release and separate controls for executor-task and GPU-task concurrency. Treat that mapping as a version-specific deployment constraint rather than copying generic CPU Spark executor sizing onto GPU nodes.&lt;/p&gt;

&lt;p&gt;Inspect which physical operators use the GPU and where the plan crosses back to CPU execution. Transfer and conversion work can outweigh a short accelerated stage. Keep the CPU baseline on the same input snapshot, output semantics, and query set so that a comparison measures the proposed platform change.&lt;/p&gt;

&lt;h2 id=&quot;join-storage-layout-to-gpu-memory-behavior&quot;&gt;Join storage layout to GPU memory behavior&lt;/h2&gt;

&lt;p&gt;Test a few file and partition layouts using the projected columns and filters that users actually run. Record listing time, file opens, bytes read, decoded batch sizes, device memory peaks, shuffle, and spill. This reveals whether a faster kernel is hidden behind metadata or unnecessary input work.&lt;/p&gt;

&lt;p&gt;A practical experiment is to hold the query fixed while changing only file consolidation, then hold layout fixed while enabling the accelerated path. That separates a storage-layout benefit from a compute benefit. Do not attribute both to the GPU when the CPU baseline also improves after compaction.&lt;/p&gt;

&lt;p&gt;Pinned host memory and concurrent tasks need a joint budget. Too much pinned memory harms the host’s ability to serve other work; too much simultaneous device demand can spill or fail. Measure two or more concurrent representative queries before deciding how many GPU executors a shared node can support comfortably.&lt;/p&gt;

&lt;p&gt;Choose local NVMe scratch for its measured spill and recovery behavior, and define what happens to incomplete output if the node disappears. The layout and snapshot controls below remain necessary even when the accelerated operator itself is correct.&lt;/p&gt;

&lt;h2 id=&quot;start-from-the-queries-and-the-update-contract&quot;&gt;Start from the queries and the update contract&lt;/h2&gt;

&lt;p&gt;List the common filters, projected columns, join keys, aggregation keys, and freshness requirements. Include occasional expensive investigations, not only the dashboard query that runs every minute.&lt;/p&gt;

&lt;p&gt;Define how new data arrives and how old data changes. An append-only event log, an upserted customer table, and a repeatedly corrected scientific dataset need different publication and compaction policies. Readers also need a rule for identifying a consistent version.&lt;/p&gt;

&lt;p&gt;Keep raw retention, curated analytical storage, and temporary query output distinct in the design. They may share infrastructure, but their access patterns and lifecycle obligations differ.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-three-ways-to-avoid-reading&quot;&gt;Distinguish three ways to avoid reading&lt;/h2&gt;

&lt;p&gt;Partition pruning excludes whole directory or object groups based on partition values. Column pruning reads only requested columns from a suitable columnar representation. Row-group or page-level statistics may allow the engine to skip additional data inside files.&lt;/p&gt;

&lt;p&gt;These mechanisms operate at different levels. A date partition is valuable when queries commonly restrict dates. It does little for a query that always reads all dates and filters only on an unrelated key. A columnar file helps a narrow projection even when no partition can be eliminated.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/apache/parquet-format/tree/apache-parquet-format-2.10.0&quot;&gt;Apache Parquet format documentation&lt;/a&gt; describes row groups, column chunks, and pages. A format’s ability to carry statistics does not guarantee that every writer produces useful statistics or that every query engine uses them for every predicate.&lt;/p&gt;

&lt;p&gt;Verify the physical query plan and actual bytes read. A SQL predicate that looks selective is not proof of storage-level skipping, especially when casts, functions, or poorly organized values interfere with pruning.&lt;/p&gt;

&lt;h2 id=&quot;partition-on-useful-bounded-dimensions&quot;&gt;Partition on useful, bounded dimensions&lt;/h2&gt;

&lt;p&gt;A common starting point is a time dimension aligned with normal queries and ingestion. Add other dimensions only when their selectivity and cardinality justify the resulting layout.&lt;/p&gt;

&lt;p&gt;Partitioning by a nearly unique identifier can produce huge numbers of tiny directories and files. Partitioning by a highly skewed tenant key can leave one enormous partition and many negligible ones. Neither outcome is repaired by calling the layout “distributed.”&lt;/p&gt;

&lt;p&gt;Estimate partition counts and size distributions over the intended retention period. Evaluate growth, late arrivals, and exceptional tenants. An attractive layout for one month may become a metadata problem after several years.&lt;/p&gt;

&lt;p&gt;Avoid encoding sensitive values into object names without considering where names appear in logs, inventories, and access tools. File naming is an information surface too.&lt;/p&gt;

&lt;h2 id=&quot;measure-the-small-file-tax&quot;&gt;Measure the small-file tax&lt;/h2&gt;

&lt;p&gt;Tiny files create work before useful data processing begins: listing, metadata lookup, task scheduling, opens, and footer reads. In object storage, request latency and request counts can matter even when total bytes are modest. On a shared filesystem, metadata operations can become the limiting resource.&lt;/p&gt;

&lt;p&gt;Use an illustrative comparison: one terabyte split into one million files presents a very different planning and opening workload from the same bytes split into several thousand files. That observation does not establish a universal ideal size. Large files can reduce parallelism for some readers or make small updates more expensive.&lt;/p&gt;

&lt;p&gt;Measure planning time separately from scan time. Count files opened, tasks launched, bytes read, and useful rows returned. A result that improves only after caching the file listing points toward metadata or planning work rather than raw sequential bandwidth.&lt;/p&gt;

&lt;h2 id=&quot;size-files-and-row-groups-together-with-concurrency&quot;&gt;Size files and row groups together with concurrency&lt;/h2&gt;

&lt;p&gt;File size influences task granularity and object overhead. Row-group size influences memory, statistics granularity, and opportunities for parallel reading. Compression changes the relationship between stored bytes and decoded memory.&lt;/p&gt;

&lt;p&gt;Choose a few candidate layouts and benchmark the actual reader. Include narrow and wide projections, selective and broad filters, and realistic concurrent queries. Monitor decoded memory and spill, not just compressed bytes on disk.&lt;/p&gt;

&lt;p&gt;Do not assume more partitions always mean more speed. Very fine task granularity can spend more time on scheduling than computation. Very coarse granularity can leave workers idle behind a small number of long tasks.&lt;/p&gt;

&lt;h2 id=&quot;make-compaction-a-correctness-operation&quot;&gt;Make compaction a correctness operation&lt;/h2&gt;

&lt;p&gt;Compaction rewrites layout without intending to change logical content. Verify that intent. Compare record keys, counts, duplicates, null handling, and aggregates appropriate to the data. Use stronger row-level or content checks where the consequences warrant them.&lt;/p&gt;

&lt;p&gt;Publish the compacted version through a snapshot or manifest mechanism that prevents readers from mixing old and new files. An object directory is not automatically a transaction. Overwriting files while a long-running query lists and reads them can create an inconsistent view.&lt;/p&gt;

&lt;p&gt;Retain old objects until the reader and recovery policy allows removal. A successful compaction write does not establish that all readers have stopped using the prior version.&lt;/p&gt;

&lt;h2 id=&quot;include-shuffle-and-joins-in-the-diagnosis&quot;&gt;Include shuffle and joins in the diagnosis&lt;/h2&gt;

&lt;p&gt;A well-pruned scan can still feed a poor join. Inspect intermediate row counts, partition skew, shuffle bytes, spill, and the longest tasks. A many-to-many join can create more output than the original dataset by orders of magnitude.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://raw.githubusercontent.com/apache/spark/v3.5.1/docs/sql-performance-tuning.md&quot;&gt;Spark 3.5.1 tuning documentation&lt;/a&gt; covers file scan partition controls, join strategies, and adaptive execution. Those controls influence execution; they do not remove the need to understand the data’s keys and distributions.&lt;/p&gt;

&lt;p&gt;Keep the scan and shuffle measurements separate so that a layout improvement is credited for what it actually changed.&lt;/p&gt;

&lt;h2 id=&quot;keep-an-evidence-backed-layout-decision&quot;&gt;Keep an evidence-backed layout decision&lt;/h2&gt;

&lt;p&gt;Record the dataset snapshot, writer and reader versions, compression, partition columns, file and row-group size distributions, query set, cache state, concurrency, and measured results. Include the cost and operational duration of compaction.&lt;/p&gt;

&lt;p&gt;Choose the layout that improves the important workload within the update and recovery constraints. Revisit it when query patterns or ingestion behavior change. Keep the benchmark queries with the layout record. They will help determine whether the next ingestion or query change calls for a different layout.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Wazuh file integrity monitoring: start with files someone will investigate</title>
    <link href="https://www.wirewalk.com/writing/wazuh-file-integrity-baselines/"/>
    <published>2025-08-18T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/wazuh-file-integrity-baselines/</id>
    <summary>A selective baseline and a tested response path make file-change alerts useful.</summary>
    <content type="html">&lt;p&gt;On a busy server, monitoring every file change can bury the modifications someone needs to investigate. Start Wazuh file integrity monitoring with paths that have clear owners: authentication settings, service definitions and privileged automation, for example.&lt;/p&gt;

&lt;h2 id=&quot;choose-a-meaningful-baseline&quot;&gt;Choose a meaningful baseline&lt;/h2&gt;

&lt;p&gt;Start with authentication configuration, service definitions, privileged automation, and selected application configuration. Exclude noisy runtime data only after understanding what would be lost. A blanket exclusion for an entire application tree can remove the very files an attacker would alter.&lt;/p&gt;

&lt;p&gt;Wazuh documents scheduled and real-time integrity monitoring and platform-dependent capabilities in its &lt;a href=&quot;https://documentation.wazuh.com/current/user-manual/capabilities/file-integrity/index.html&quot;&gt;FIM guide&lt;/a&gt;. Confirm which mode the target operating system and configured paths support.&lt;/p&gt;

&lt;h2 id=&quot;use-a-harmless-configuration-fixture&quot;&gt;Use a harmless configuration fixture&lt;/h2&gt;

&lt;p&gt;Before applying a broad production policy, create a dedicated directory containing a synthetic text file. Add only that directory to the lab agent’s configured monitoring scope using the documented configuration method.&lt;/p&gt;

&lt;p&gt;Record the baseline, then make three changes separately: edit the contents, change permissions, and remove the test file. Wait for the configured detection mode and interval after each operation.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Test&lt;/th&gt;
      &lt;th&gt;Evidence expected&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Content edit&lt;/td&gt;
      &lt;td&gt;Correct path and changed integrity information&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Permission change&lt;/td&gt;
      &lt;td&gt;Relevant attribute change, if enabled and supported&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Removal&lt;/td&gt;
      &lt;td&gt;Deletion event with the same file identity/path context&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Agent offline&lt;/td&gt;
      &lt;td&gt;Missing-agent or freshness signal&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Do not claim attribution unless the configured platform feature actually supplies it. A file change event can establish that a change happened without establishing the process or person responsible.&lt;/p&gt;

&lt;h2 id=&quot;follow-the-alert-to-an-owner&quot;&gt;Follow the alert to an owner&lt;/h2&gt;

&lt;p&gt;Inspect the event on the manager and in the analyst view. Confirm hostname, path, timestamp, and the distinction between the original event and ingestion time. A correctly collected event assigned to no one is not an operational detection.&lt;/p&gt;

&lt;p&gt;Write a response note for each monitored path family. An unexpected SSH configuration change may require reviewing a deployment record and testing effective settings. An application template change may belong to the application team. Different changes should not all trigger the same emergency response.&lt;/p&gt;

&lt;h2 id=&quot;handle-legitimate-deployments&quot;&gt;Handle legitimate deployments&lt;/h2&gt;

&lt;p&gt;Associate maintenance windows with an approved change, but preserve the events. Suppressing all file integrity activity during deployment can conceal an unrelated change. Prefer scoped interpretation and review over discarding the evidence.&lt;/p&gt;

&lt;p&gt;After rebuilding an agent or reinstalling a host, confirm that the new baseline is intentional. A newly initialized baseline is not proof that the host matches a trusted image.&lt;/p&gt;

&lt;h2 id=&quot;control-volume-before-expanding&quot;&gt;Control volume before expanding&lt;/h2&gt;

&lt;p&gt;Measure events per host, storage growth, and analyst effort on a representative subset. Expand only when expected events arrive and ordinary maintenance remains understandable.&lt;/p&gt;

&lt;p&gt;Finish by repeating the harmless fixture after a policy change or manager upgrade. Pair FIM with &lt;a href=&quot;/writing/missing-security-telemetry-prometheus/&quot;&gt;missing telemetry monitoring&lt;/a&gt; so a quiet dashboard cannot conceal a disconnected source.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Snort 3 rule validation: a loaded rule is not a tested detection</title>
    <link href="https://www.wirewalk.com/writing/snort3-rule-validation/"/>
    <published>2025-07-25T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/snort3-rule-validation/</id>
    <summary>Use matching and nonmatching captures, explicit actions, and live enforcement tests to validate a rule change.</summary>
    <content type="html">&lt;p&gt;A Snort rule can load cleanly and never match its intended traffic. It can also match too broadly, with little consequence in an offline test but a serious outage once enabled inline. Test syntax, matching behavior and enforcement separately.&lt;/p&gt;

&lt;h2 id=&quot;pin-the-inputs&quot;&gt;Pin the inputs&lt;/h2&gt;

&lt;p&gt;Keep the Snort version, Lua configuration, rule file, fixture PCAP, and expected signature identifiers in the change record. Pin the fixture by checksum. A result without those inputs is difficult to reproduce after a ruleset update.&lt;/p&gt;

&lt;p&gt;The official guide separates &lt;a href=&quot;https://docs.snort.org/start/configuration&quot;&gt;configuration&lt;/a&gt;, &lt;a href=&quot;https://docs.snort.org/start/inspection&quot;&gt;reading traffic&lt;/a&gt;, and &lt;a href=&quot;https://docs.snort.org/rules/headers/actions&quot;&gt;rule actions&lt;/a&gt;. Use the options for the installed Snort 3 package; Snort 2 configuration examples are not interchangeable.&lt;/p&gt;

&lt;h2 id=&quot;validate-syntax-and-behavior-separately&quot;&gt;Validate syntax and behavior separately&lt;/h2&gt;

&lt;p&gt;For a lab installation with configuration at the example path:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;snort &lt;span class=&quot;nt&quot;&gt;-T&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; /etc/snort/snort.lua
snort &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; /etc/snort/snort.lua &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; ./approved-match.pcap &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; alert_fast
snort &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; /etc/snort/snort.lua &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; ./approved-nonmatch.pcap &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; alert_fast
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Supply your own approved synthetic fixtures and confirm that the relevant rule file is included by the configuration. The commands do not create the fixtures. Output location and available logging modules should be verified against the installation.&lt;/p&gt;

&lt;p&gt;The first run should load successfully. The matching fixture should produce the intended rule identifier. The nonmatching fixture should not produce that identifier. Other unrelated alerts need separate interpretation rather than being counted as a test failure automatically.&lt;/p&gt;

&lt;h2 id=&quot;test-the-rules-assumptions&quot;&gt;Test the rule’s assumptions&lt;/h2&gt;

&lt;p&gt;A fixture should represent the actual protocol and normalization the rule expects. A string in a raw packet is not necessarily the same as a value in an HTTP inspector’s buffer. Include benign variations that previously caused false positives, such as a similar URI or legitimate application payload.&lt;/p&gt;

&lt;p&gt;Treat negative fixtures as part of the rule’s specification. They explain what the rule must leave alone and protect that behavior when the signature is tightened later.&lt;/p&gt;

&lt;h2 id=&quot;prove-enforcement-on-the-final-path&quot;&gt;Prove enforcement on the final path&lt;/h2&gt;

&lt;p&gt;Offline alert output does not prove a client transaction was blocked. For an IPS policy, use a controlled live path, a harmless match, and an explicit expected client result. Check the configured action and capture mode together.&lt;/p&gt;

&lt;p&gt;Do not infer physical fail-open or fail-closed behavior from a rule action. Those depend on the deployed forwarding and failure design. Rehearse rollback and ordinary application traffic as described in the &lt;a href=&quot;/writing/suricata-ips-controlled-rollout/&quot;&gt;inline rollout article&lt;/a&gt;; the engineering tests apply even though the configuration syntax differs.&lt;/p&gt;

&lt;h2 id=&quot;keep-the-result-small-and-auditable&quot;&gt;Keep the result small and auditable&lt;/h2&gt;

&lt;p&gt;An acceptance record can be a table of fixture hashes, expected signature IDs, observed IDs, and pass/fail outcomes. Add client evidence for enforcement tests. Repeat that small set of cases with each rule change, before the new rules reach the live enforcement path.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Zeek: turn a connection into an investigation trail</title>
    <link href="https://www.wirewalk.com/writing/zeek-network-investigation-context/"/>
    <published>2025-07-01T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/zeek-network-investigation-context/</id>
    <summary>Use connection identifiers to connect evidence while keeping the limits of passive visibility explicit.</summary>
    <content type="html">&lt;p&gt;An alert rarely explains the whole connection. An analyst also needs to know what preceded it, which service answered and what followed. Zeek’s connection and protocol logs provide that context when the signature alone leaves questions open.&lt;/p&gt;

&lt;h2 id=&quot;begin-with-a-known-capture&quot;&gt;Begin with a known capture&lt;/h2&gt;

&lt;p&gt;On a host with Zeek installed, process an approved synthetic PCAP from a clean output directory:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ./zeek-lab-output
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ./zeek-lab-output
zeek &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; ../approved-test.pcap LogAscii::use_json&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;T
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This writes local logs. It does not send traffic or validate the location of a production sensor. Zeek documents the workflow in its &lt;a href=&quot;https://docs.zeek.org/en/v8.2.1/quickstart.html&quot;&gt;quick start&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Choose a fixture whose endpoints and expected protocols are known. A large unexplained capture is a poor first test because it makes missing evidence difficult to recognize.&lt;/p&gt;

&lt;h2 id=&quot;follow-one-connection&quot;&gt;Follow one connection&lt;/h2&gt;

&lt;p&gt;Inspect a compact view of JSON connection records:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jq &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{uid,origin:.&quot;id.orig_h&quot;,destination:.&quot;id.resp_h&quot;,
  port:.&quot;id.resp_p&quot;,proto,service,duration}&apos;&lt;/span&gt; conn.log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.zeek.org/en/current/reference/logs/conn.html&quot;&gt;connection-log reference&lt;/a&gt; explains the fields and the connection UID. Use the UID to locate related protocol records where that field is present. Preserve sensor identity and time context when combining records from multiple systems.&lt;/p&gt;

&lt;p&gt;Ask a specific question: did this host query a name and then connect to an unexpected service? The DNS answer and the subsequent destination can support a hypothesis. They do not prove that the same process or user caused both actions without additional endpoint evidence.&lt;/p&gt;

&lt;h2 id=&quot;know-what-encryption-removes&quot;&gt;Know what encryption removes&lt;/h2&gt;

&lt;p&gt;TLS can leave useful connection and handshake metadata while hiding application contents. Visibility varies with protocol and configuration. A missing HTTP log for an encrypted connection is not, by itself, a sensor failure.&lt;/p&gt;

&lt;p&gt;Likewise, traffic that never traverses the observation point cannot appear in the logs. Capture loss, asymmetric routing, and mirror oversubscription can create partial records. Investigate those conditions before interpreting absence as proof that communication did not happen.&lt;/p&gt;

&lt;h2 id=&quot;build-a-repeatable-analyst-exercise&quot;&gt;Build a repeatable analyst exercise&lt;/h2&gt;

&lt;p&gt;Prepare a small scenario containing a DNS lookup, an allowed web request, and a connection to a lab-only destination. Ask a second operator to reconstruct the sequence using the logs and the documented queries. Record which claims can be established and which require endpoint or identity records.&lt;/p&gt;

&lt;p&gt;Then repeat on the live monitored path using approved harmless traffic. Verify that the logs reach the analyst’s system within the agreed window and remain queryable after rotation.&lt;/p&gt;

&lt;h2 id=&quot;avoid-turning-metadata-into-certainty&quot;&gt;Avoid turning metadata into certainty&lt;/h2&gt;

&lt;p&gt;A large transfer is not automatically exfiltration. A new destination is not automatically malicious. Use inventory, business purpose, endpoint process information, and access records to test the hypothesis.&lt;/p&gt;

&lt;p&gt;Document which questions the logs can answer and where encryption or sensor placement leaves gaps. See &lt;a href=&quot;/writing/encrypted-traffic-detection-boundaries/&quot;&gt;encrypted traffic visibility&lt;/a&gt; for the complementary sensor-placement review.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>NVIDIA training cluster design: NVLink, InfiniBand, NCCL, and parallelism</title>
    <link href="https://www.wirewalk.com/writing/distributed-training-parallelism-topology/"/>
    <published>2025-06-18T10:00:00-04:00</published>
    <updated>2025-06-18T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/distributed-training-parallelism-topology/</id>
    <summary>Map distributed training onto NVIDIA GPU servers using a memory ledger, NVLink and PCIe topology, ConnectX and InfiniBand placement, NCCL transport evidence, and recoverable sharded checkpoints.</summary>
    <content type="html">&lt;p&gt;Adding GPUs can make a training step slower if the new parallel groups communicate over the wrong links. NVLink, PCIe and the network between nodes carry different costs, and the model’s decomposition determines how often each path is used.&lt;/p&gt;

&lt;p&gt;Map that communication onto the intended NVIDIA servers and fabric. Check that the allocation can hold the model state, feed the GPUs and reload a checkpoint before committing to a larger device count.&lt;/p&gt;

&lt;h2 id=&quot;map-the-physical-paths-to-the-parallel-groups&quot;&gt;Map the physical paths to the parallel groups&lt;/h2&gt;

&lt;p&gt;Inventory GPU-to-GPU connectivity, CPU sockets, PCIe switches, NIC placement, link speeds, and storage paths. Distinguish GPUs connected through NVLink or an NVSwitch fabric from devices whose communication traverses PCIe. Record the exact server design; the interconnect is not implied by the GPU architecture name.&lt;/p&gt;

&lt;p&gt;For inter-node communication, verify the installed ConnectX adapters, InfiniBand fabric, routing, firmware, and compatible communication software. An adapter link being up does not prove the training process uses RDMA. Record GPU-to-NIC affinity and rank placement so that a good test can be reproduced.&lt;/p&gt;

&lt;p&gt;Place tensor-parallel groups on fast suitable paths because their intra-layer communication can be frequent. Choose data-parallel and pipeline boundaries using measured communication volume and stage balance. These are starting hypotheses to test, not an assumption that every model should use one fixed mapping.&lt;/p&gt;

&lt;h2 id=&quot;prove-the-nccl-path-before-interpreting-scale&quot;&gt;Prove the NCCL path before interpreting scale&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.nvidia.com/deeplearning/nccl/archives/nccl_2205/user-guide/docs/overview.html&quot;&gt;NCCL’s archived 2.20 overview&lt;/a&gt; describes topology-aware GPU communication across NVLink, PCIe, InfiniBand, and sockets. NCCL is a communication library; it does not configure a healthy fabric or guarantee that the application selects the intended transport.&lt;/p&gt;

&lt;p&gt;Capture library versions and a small diagnostic log from an isolated allocation. Confirm the selected interfaces and transport, then run a collective workload matching the application’s participating devices and relevant message sizes. Compare single-node and multi-node behavior before changing model hyperparameters. Test one communication path at a time and preserve the logs rather than enabling verbose output indefinitely on a large run.&lt;/p&gt;

&lt;p&gt;Finally, profile the actual training step. Good isolated collective bandwidth does not establish that communication is overlapped, that one rank is not starved by input, or that a pipeline stage is balanced. Qualify checkpoint writes and restart reads over the same fabric and storage system under representative concurrent load. The design must carry training and recovery traffic, not merely pass a standalone network benchmark.&lt;/p&gt;

&lt;h2 id=&quot;write-down-the-memory-problem&quot;&gt;Write down the memory problem&lt;/h2&gt;

&lt;p&gt;Account for parameters, gradients, optimizer state, activations, temporary workspaces, and communication buffers. A model that cannot fit because of optimizer state needs a different intervention from one dominated by long-sequence activations.&lt;/p&gt;

&lt;p&gt;Mixed precision changes several terms, often in different ways. An implementation may keep low-precision weights for computation, higher-precision optimizer state, and temporary buffers in another format. Do not infer the full footprint by multiplying parameter count by the weight storage type.&lt;/p&gt;

&lt;p&gt;Measure peak memory at representative sequence length and microbatch size. Include a complete optimizer step, evaluation, and checkpoint operation. A forward-only estimate is not a training budget.&lt;/p&gt;

&lt;h2 id=&quot;define-the-global-batch-precisely&quot;&gt;Define the global batch precisely&lt;/h2&gt;

&lt;p&gt;For ordinary synchronous data parallelism, the global batch is the per-replica microbatch multiplied by the number of data replicas and the number of accumulation steps. Tensor-parallel and pipeline-parallel workers collaborate on a replica and do not each add an independent data batch.&lt;/p&gt;

&lt;p&gt;Keep token count in view when sequences have variable lengths. Equal numbers of examples can represent very different amounts of data. Record the loss normalization rule, padding treatment, and the unit used by the learning-rate schedule.&lt;/p&gt;

&lt;p&gt;When changing device count, decide whether global batch remains fixed. If it changes, throughput and convergence have changed together. Scaling efficiency alone cannot explain the resulting quality difference.&lt;/p&gt;

&lt;h2 id=&quot;use-data-parallelism-when-replication-fits&quot;&gt;Use data parallelism when replication fits&lt;/h2&gt;

&lt;p&gt;In synchronous data parallelism, replicas process different data and synchronize gradients. It is conceptually straightforward when each replica can hold the necessary training state.&lt;/p&gt;

&lt;p&gt;Communication depends on gradient volume, collective implementation, and overlap with computation. Small microbatches can leave too little useful compute to hide synchronization. Many tiny gradient transfers can behave differently from fewer large transfers even when the total bytes are similar.&lt;/p&gt;

&lt;p&gt;Inspect a training trace. Determine whether collectives wait for computation, computation waits for collectives, or both wait for the data loader. An isolated bandwidth test is useful, but it cannot establish whether the application’s communication is overlapped successfully.&lt;/p&gt;

&lt;h2 id=&quot;shard-state-to-reduce-redundant-memory&quot;&gt;Shard state to reduce redundant memory&lt;/h2&gt;

&lt;p&gt;State sharding distributes some combination of optimizer state, gradients, and parameters across data-parallel workers. The &lt;a href=&quot;https://arxiv.org/abs/1910.02054&quot;&gt;ZeRO paper, first submitted in October 2019&lt;/a&gt;, describes eliminating memory redundancy in distributed training.&lt;/p&gt;

&lt;p&gt;The memory saving is not free. The chosen sharding scheme determines what must be gathered or reduced and when. More aggressive sharding can create more sensitivity to interconnect bandwidth, latency, and the order in which modules execute.&lt;/p&gt;

&lt;p&gt;Map the actual implementation rather than relying only on a stage label. Record the sharding group, materialized parameter sizes, prefetch behavior, and checkpoint format. A configuration that fits on a fast local fabric may perform poorly when the same group spans slower node boundaries.&lt;/p&gt;

&lt;h2 id=&quot;keep-tightly-coupled-tensor-work-close&quot;&gt;Keep tightly coupled tensor work close&lt;/h2&gt;

&lt;p&gt;Tensor parallelism partitions operations within layers. Workers repeatedly exchange intermediate results, so the communication path is part of the layer execution rather than an occasional end-of-step expense.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://arxiv.org/abs/1909.08053&quot;&gt;Megatron-LM paper, first submitted in September 2019&lt;/a&gt;, provides an early concrete implementation of intra-layer model parallelism for large language models. Its architecture is historical evidence for the method, not a performance prediction for a different cluster.&lt;/p&gt;

&lt;p&gt;Prefer to place tightly coupled groups on the fastest suitable links where capacity allows. Verify actual GPU peer connectivity and NIC paths rather than assuming all devices in a node have equivalent access. Record the rank mapping so that another run can reproduce it.&lt;/p&gt;

&lt;h2 id=&quot;use-pipeline-parallelism-with-enough-work-in-flight&quot;&gt;Use pipeline parallelism with enough work in flight&lt;/h2&gt;

&lt;p&gt;Pipeline parallelism places groups of layers on different workers and passes activations between stages. It helps distribute model capacity but introduces scheduling bubbles and stage imbalance.&lt;/p&gt;

&lt;p&gt;Microbatches can keep several stages occupied. Too few leave devices idle; too many can increase activation pressure or scheduling overhead. The best arrangement depends on the schedule, stage boundaries, and model structure.&lt;/p&gt;

&lt;p&gt;Balance stages using measured execution time and memory, not equal numbers of layers. Embeddings, output heads, and long-context operations can have different costs from a typical middle layer. Inspect the slowest stage across repeated steps.&lt;/p&gt;

&lt;h2 id=&quot;test-combinations-with-a-controlled-scaling-matrix&quot;&gt;Test combinations with a controlled scaling matrix&lt;/h2&gt;

&lt;p&gt;Choose a small matrix of candidate layouts. For each, record device count, data replicas, tensor and pipeline groups, sharding scheme, microbatch size, accumulation, global batch, sequence length, useful tokens per second, and peak memory.&lt;/p&gt;

&lt;p&gt;For a fixed workload, speedup is reference time divided by distributed time. Efficiency is speedup divided by the resource multiplier. Keep the comparison honest: a reference that uses a different precision, sequence length, or input pipeline cannot isolate parallelism effects.&lt;/p&gt;

&lt;p&gt;Evaluate convergence at a matched training budget as well as short-run speed. A fast step that requires more steps to reach the target quality may have a higher total cost.&lt;/p&gt;

&lt;h2 id=&quot;verify-input-distribution-and-recovery&quot;&gt;Verify input distribution and recovery&lt;/h2&gt;

&lt;p&gt;Ensure each data replica receives the intended records. Check for accidental duplication across replicas and for incorrect sampler behavior after resume. Randomize deliberately, preserve seeds, and document any repeated or skipped samples at checkpoint boundaries.&lt;/p&gt;

&lt;p&gt;Rehearse a worker failure in an isolated run. Determine whether the checkpoint can reload under the same topology and whether a changed device count requires conversion or is unsupported. A sharded checkpoint is not automatically portable to every serving or training arrangement.&lt;/p&gt;

&lt;p&gt;Choose the simplest layout that fits, scales acceptably, and can be recovered by the operating team. Keep the rank mapping and measurements with that layout so the next run can reproduce the same placement.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Suricata IPS: turn detection into blocking without guessing about failure</title>
    <link href="https://www.wirewalk.com/writing/suricata-ips-controlled-rollout/"/>
    <published>2025-06-07T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/suricata-ips-controlled-rollout/</id>
    <summary>An inline sensor is part of the availability path. Validate forwarding, selective blocking, and failure behavior separately.</summary>
    <content type="html">&lt;p&gt;Changing a Suricata rule from alert to drop can interrupt legitimate work. Before enabling it, check that traffic takes the intended enforcement path and agree what should happen if the sensor fails. Both decisions matter as much as the signature.&lt;/p&gt;

&lt;h2 id=&quot;state-the-enforcement-design&quot;&gt;State the enforcement design&lt;/h2&gt;

&lt;p&gt;Suricata documents inline operation at Layer 2 and Layer 3. Its IPS concept uses drop or reject actions for unwanted traffic. AF_PACKET inline deployments require an explicitly paired interface design. See &lt;a href=&quot;https://docs.suricata.io/en/suricata-8.0.1/ips/ips-concept.html&quot;&gt;IPS concepts&lt;/a&gt; and &lt;a href=&quot;https://docs.suricata.io/en/suricata-8.0.1/ips/setting-up-ipsinline-for-linux.html&quot;&gt;Linux inline setup&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These links describe Suricata 8.0.1; use the equivalent pages for the installed supported release before configuring production. The design tests below do not depend on a particular interface name or release default.&lt;/p&gt;

&lt;h2 id=&quot;establish-the-failure-policy-before-installation&quot;&gt;Establish the failure policy before installation&lt;/h2&gt;

&lt;p&gt;Decide whether the protected service should lose connectivity or pass traffic without inspection when the enforcement path fails. Hardware bypass, queue behavior, routing, and process failure can produce different outcomes. “Fail open” in a slide deck is not an observed result.&lt;/p&gt;

&lt;p&gt;Document a bypass procedure and the person authorized to invoke it. It should be reachable through a management path independent of the traffic being inspected.&lt;/p&gt;

&lt;h2 id=&quot;use-three-traffic-classes&quot;&gt;Use three traffic classes&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Class&lt;/th&gt;
      &lt;th&gt;Expected outcome&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Ordinary business transaction&lt;/td&gt;
      &lt;td&gt;Allowed, within agreed latency&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Benign fixture matching the test drop rule&lt;/td&gt;
      &lt;td&gt;Blocked and logged&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Similar fixture that should not match&lt;/td&gt;
      &lt;td&gt;Allowed&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Run these in an isolated lab first. Use a harmless synthetic signature rather than malware. Confirm the blocked transaction fails at the client and is recorded by the sensor. An alert alone does not prove enforcement.&lt;/p&gt;

&lt;p&gt;Record the exact rule set and configuration. Start production rollout with a small, justified set of blocking rules after observing them in alerting mode. Retain an explicit rollback version rather than editing rules under pressure.&lt;/p&gt;

&lt;h2 id=&quot;exercise-operational-failures&quot;&gt;Exercise operational failures&lt;/h2&gt;

&lt;p&gt;In the lab, stop the process, remove one test link, and simulate loss of management access one at a time. Inspect client behavior for each condition. Repeat with a long-lived connection as well as new connections; the outcomes may differ.&lt;/p&gt;

&lt;p&gt;Under representative traffic, measure packet drops, application error rates, and latency percentiles. An inline system with acceptable average latency can still cause intermittent application timeouts.&lt;/p&gt;

&lt;h2 id=&quot;keep-exceptions-narrow-and-expiring&quot;&gt;Keep exceptions narrow and expiring&lt;/h2&gt;

&lt;p&gt;A false positive should produce a scoped exception with the affected service, rule identifier, owner, and review date. Disabling an entire ruleset because one application fails makes the enforcement policy hard to understand.&lt;/p&gt;

&lt;p&gt;Before declaring the deployment accepted, rerun the three traffic classes through the final path and demonstrate rollback. Preserve the results with the change record. Pair this with &lt;a href=&quot;/writing/detection-rules-regression-tests/&quot;&gt;detection regression tests&lt;/a&gt; so future rule updates do not silently alter the policy.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Suricata IDS: prove the sensor can see the traffic you care about</title>
    <link href="https://www.wirewalk.com/writing/suricata-ids-first-sensor/"/>
    <published>2025-05-14T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/suricata-ids-first-sensor/</id>
    <summary>Start with capture visibility and a harmless detection fixture before counting alerts.</summary>
    <content type="html">&lt;p&gt;Suricata can be running with fresh rules while seeing none of the traffic you meant to inspect. Before tuning detection, prove that representative packets reach the sensor, trigger the expected rule and arrive at the analyst’s console.&lt;/p&gt;

&lt;h2 id=&quot;define-the-observation-point&quot;&gt;Define the observation point&lt;/h2&gt;

&lt;p&gt;Draw the path from a representative client to the protected service. Mark switches, virtual switches, firewalls, and encryption boundaries. A SPAN port observing an internet uplink may miss traffic between two servers on the same VLAN. A mirror that carries only one direction can impair stream interpretation.&lt;/p&gt;

&lt;p&gt;Record the capture interface, expected networks, link capacity, and whether traffic can bypass the observation point. This is the sensor’s coverage statement. Avoid describing it as coverage of the entire enterprise.&lt;/p&gt;

&lt;h2 id=&quot;validate-configuration-and-a-known-capture&quot;&gt;Validate configuration and a known capture&lt;/h2&gt;

&lt;p&gt;On a lab host with Suricata 7.x and its matching configuration, use the documented test and offline modes:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;suricata &lt;span class=&quot;nt&quot;&gt;-T&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; /etc/suricata/suricata.yaml
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ./suricata-lab-output
suricata &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; ./approved-test.pcap &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; /etc/suricata/suricata.yaml &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; ./suricata-lab-output
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The PCAP is an approved fixture you supply; it is not downloaded or generated by these commands. It should contain synthetic traffic matching a known enabled test signature. Consult the &lt;a href=&quot;https://docs.suricata.io/en/suricata-7.0.8/command-line-options.html&quot;&gt;command-line reference&lt;/a&gt; for your package’s options and permissions.&lt;/p&gt;

&lt;p&gt;A configuration test establishes syntax and loading, not detection correctness. The offline run establishes behavior on a fixture, not live capture visibility.&lt;/p&gt;

&lt;h2 id=&quot;inspect-the-event-then-the-live-path&quot;&gt;Inspect the event, then the live path&lt;/h2&gt;

&lt;p&gt;With EVE alerts enabled in the configuration:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jq &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;select(.event_type == &quot;alert&quot;) |
  {timestamp,src_ip,dest_ip,signature:.alert.signature}&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ./suricata-lab-output/eve.json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.suricata.io/en/suricata-7.0.8/output/eve/eve-json-output.html&quot;&gt;Suricata’s EVE documentation&lt;/a&gt; describes the event output. Confirm the expected signature identifier and endpoints rather than accepting any alert as success.&lt;/p&gt;

&lt;p&gt;Next generate the approved benign test on the actual monitored path. Find its event locally and in the SIEM. Record the delay and the rule revision. If it appears offline but not live, investigate placement, capture filtering, and packet delivery before changing the detection rule.&lt;/p&gt;

&lt;h2 id=&quot;measure-loss-under-ordinary-load&quot;&gt;Measure loss under ordinary load&lt;/h2&gt;

&lt;p&gt;Watch capture and decoder statistics during representative busy periods. Compare the switch mirror’s capacity with the traffic it aggregates. A mirror receiving two directions from several links can be oversubscribed even when the sensor’s nominal interface speed looks adequate.&lt;/p&gt;

&lt;p&gt;Do not publish a throughput guarantee from a small fixture. Keep the configuration, rule count, traffic mix, CPU allocation, and observed drop statistics together.&lt;/p&gt;

&lt;h2 id=&quot;acceptance-evidence&quot;&gt;Acceptance evidence&lt;/h2&gt;

&lt;p&gt;Retain configuration-test output, fixture identity, expected alert, live-path alert, SIEM arrival, and coverage limitations. Keep those results together so coverage can be checked after a network or sensor change. Blocking needs a separate &lt;a href=&quot;/writing/suricata-ips-controlled-rollout/&quot;&gt;IPS rollout&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Storage auditing: prove an event reaches an investigator</title>
    <link href="https://www.wirewalk.com/writing/storage-audit-evidence-pipeline/"/>
    <published>2025-04-20T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/storage-audit-evidence-pipeline/</id>
    <summary>An enabled audit setting is the start of an evidence pipeline, not proof that usable records exist.</summary>
    <content type="html">&lt;p&gt;The storage system recorded the event, but the investigator cannot find it. Somewhere between the local log and the security console, it was filtered, delayed, dropped or parsed incorrectly. Generate a known operation and follow that one event through the whole path.&lt;/p&gt;

&lt;h2 id=&quot;define-the-event-contract&quot;&gt;Define the event contract&lt;/h2&gt;

&lt;p&gt;Choose the questions the audit trail must answer: who accessed a sensitive path, which client was involved, what operation occurred, whether it succeeded, and when. Identify which of those fields the deployed platform and protocol actually emit.&lt;/p&gt;

&lt;p&gt;For VAST, PowerScale/Isilon, and WEKA, verify release-specific audit support and configuration with the vendor. Do not assume the same event coverage across NFS, SMB, S3, and management APIs. File data access and administrative changes are separate event families.&lt;/p&gt;

&lt;h2 id=&quot;create-a-controlled-evidence-marker&quot;&gt;Create a controlled evidence marker&lt;/h2&gt;

&lt;p&gt;Use an approved synthetic filename such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;audit-validation-2026-09-09.txt&lt;/code&gt; in a test directory. Perform a read, a write, and a denied operation using distinct test identities. Record local UTC times and the client address without inserting confidential data into filenames.&lt;/p&gt;

&lt;p&gt;Follow each expected event through the pipeline:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Stage&lt;/th&gt;
      &lt;th&gt;Check&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Storage producer&lt;/td&gt;
      &lt;td&gt;Operation is in the configured audit scope&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Export or collector&lt;/td&gt;
      &lt;td&gt;Event leaves the source without an unexplained gap&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Transport&lt;/td&gt;
      &lt;td&gt;Authentication and delivery behave as intended&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;SIEM&lt;/td&gt;
      &lt;td&gt;Fields remain searchable and correctly typed&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Analyst workflow&lt;/td&gt;
      &lt;td&gt;Saved query finds the test within the agreed delay&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A file modification does not necessarily produce every event type in this example. Set expectations from the product’s documented event model first.&lt;/p&gt;

&lt;h2 id=&quot;keep-clocks-and-identifiers-usable&quot;&gt;Keep clocks and identifiers usable&lt;/h2&gt;

&lt;p&gt;Preserve the event’s original timestamp and the ingest timestamp. Their difference helps distinguish a delayed producer from a delayed collector. Retain the source identity, cluster identifier, and protocol alongside normalized fields.&lt;/p&gt;

&lt;p&gt;Network telemetry can provide corroboration. Zeek’s &lt;a href=&quot;https://docs.zeek.org/en/current/reference/logs/conn.html&quot;&gt;connection log&lt;/a&gt; records connection context, but it is not a substitute for a storage authorization record. Encrypted or unobserved traffic further limits what a network sensor can establish.&lt;/p&gt;

&lt;h2 id=&quot;test-the-pipelines-absence-signal&quot;&gt;Test the pipeline’s absence signal&lt;/h2&gt;

&lt;p&gt;Schedule a harmless recurring validation event where practical and monitor its freshness. A reachable collector with no recent storage events is not necessarily healthy. Prometheus documents &lt;a href=&quot;https://prometheus.io/docs/prometheus/latest/querying/functions/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;absent_over_time&lt;/code&gt;&lt;/a&gt; for detecting missing series; an inventory-based check is also needed for sources that disappear from discovery entirely.&lt;/p&gt;

&lt;p&gt;Choose a delay threshold from expected traffic and operating hours. A quiet archive should not generate an alert merely because no user accessed it overnight.&lt;/p&gt;

&lt;h2 id=&quot;protect-the-evidence-itself&quot;&gt;Protect the evidence itself&lt;/h2&gt;

&lt;p&gt;Restrict access to raw logs, define retention, and record who may alter collector configuration. Audit logs can expose paths, usernames, and business activity. Forward them to a boundary that a routine storage administrator cannot silently erase.&lt;/p&gt;

&lt;p&gt;Keep the test event IDs and the investigator query with the deployment record. Repeat after storage upgrades, parser changes, and collector migrations.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Sizing NVIDIA GPUs for LoRA and QLoRA: memory, PCIe, and the full training node</title>
    <link href="https://www.wirewalk.com/writing/lora-qlora-fine-tuning-memory-quality/"/>
    <published>2025-04-09T10:00:00-04:00</published>
    <updated>2025-04-09T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/lora-qlora-fine-tuning-memory-quality/</id>
    <summary>Size adapter fine-tuning infrastructure using GPU memory, activation peaks, host offload, PCIe transfers, scratch capacity, runtime compatibility, and validation of the final serving artifact.</summary>
    <content type="html">&lt;p&gt;LoRA or QLoRA may let an adaptation job fit on fewer NVIDIA GPUs. The rest of the server still matters. Once the base model fits, host RAM, PCIe transfers, preprocessing CPUs or checkpoint storage can become the limiting resource.&lt;/p&gt;

&lt;p&gt;Account for memory and transfers, then run a representative case on the intended server. Leave room for evaluation and recovery as well as steady-state training; the adapter download size tells you little about those demands.&lt;/p&gt;

&lt;h2 id=&quot;specify-the-device-and-server-configuration-precisely&quot;&gt;Specify the device and server configuration precisely&lt;/h2&gt;

&lt;p&gt;Record the exact GPU SKU and installed memory, not just “A100” or “H100.” State whether the job uses one GPU, a supported GPU partition, or a connected group, and verify how the runtime sees those devices. The &lt;a href=&quot;https://docs.nvidia.com/cuda/archive/12.4.1/hopper-tuning-guide/index.html&quot;&gt;CUDA 12.4.1 Hopper guide&lt;/a&gt; provides the architectural context; it does not size a particular adapter workload.&lt;/p&gt;

&lt;p&gt;Use representative maximum sequence lengths and supervised-token distributions for the fit test. Include one complete optimizer step, validation, and checkpoint saving. Leave explicit headroom instead of treating the last successful allocation as the operating limit. Compare useful tokens per second and total time to the required quality when evaluating a larger device.&lt;/p&gt;

&lt;p&gt;Check the kernels and precision modes actually used. A quantized base can save storage and memory without making every operation execute as four-bit arithmetic. Confirm the adapter library, quantization implementation, framework, CUDA runtime, and device architecture as a tested combination.&lt;/p&gt;

&lt;h2 id=&quot;account-for-offload-as-host-and-transfer-demand&quot;&gt;Account for offload as host and transfer demand&lt;/h2&gt;

&lt;p&gt;Offloading can move pressure from device memory to host RAM and the CPU-to-GPU path. Estimate bytes transferred per step and measure the transfers in a short trace. The &lt;a href=&quot;https://docs.nvidia.com/nsight-systems/2024.2/UserGuide/index.html&quot;&gt;Nsight Systems 2024.2 guide&lt;/a&gt; describes CUDA tracing that can help reveal waits and copies; the proposed investigation is to correlate those events with your training-step boundaries.&lt;/p&gt;

&lt;p&gt;Place CPU workers and pinned buffers with awareness of the GPU’s NUMA and PCIe attachment. Include other jobs on the node when testing host bandwidth. A configuration that succeeds on an otherwise empty server may stall when several jobs pin memory or stage data simultaneously.&lt;/p&gt;

&lt;p&gt;Budget node-local scratch for dataset shards, temporary exports, and training checkpoints. Preserve a durable completed checkpoint outside the node if node loss is in the recovery requirement. Keep training allocations and interactive serving allocations separately accounted so that a fine-tuning experiment cannot silently consume the service’s latency margin.&lt;/p&gt;

&lt;p&gt;These infrastructure checks set the feasible experiment envelope. The adapter, data, and quality controls below determine whether any configuration inside that envelope produces a useful model.&lt;/p&gt;

&lt;h2 id=&quot;understand-what-is-updated&quot;&gt;Understand what is updated&lt;/h2&gt;

&lt;p&gt;LoRA represents an update to a weight matrix using two smaller matrices. For a matrix with dimensions d by k, an adapter rank r introduces approximately r times the sum of d and k trainable parameters, instead of d times k for a full update to that matrix. The base weights remain frozen.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://arxiv.org/abs/2106.09685&quot;&gt;LoRA paper was first submitted in June 2021&lt;/a&gt;. Its central contribution is a low-rank adaptation method, not a universal claim that every task needs the same rank or that every layer should receive an adapter.&lt;/p&gt;

&lt;p&gt;QLoRA, &lt;a href=&quot;https://arxiv.org/abs/2305.14314&quot;&gt;submitted in May 2023&lt;/a&gt;, combines a frozen quantized base with trainable low-rank adapters. The paper describes NF4, double quantization, and paged optimizers. A four-bit base representation does not imply that every intermediate, adapter, gradient, or optimizer state is stored in four bits.&lt;/p&gt;

&lt;h2 id=&quot;build-a-memory-ledger&quot;&gt;Build a memory ledger&lt;/h2&gt;

&lt;p&gt;List persistent and transient allocations separately. The persistent portion includes base weights, quantization metadata, adapters, adapter gradients, and optimizer state. The transient portion includes activations, attention workspaces, temporary dequantized values, communication buffers where applicable, and framework overhead.&lt;/p&gt;

&lt;p&gt;As an illustrative lower-bound calculation, seven billion parameters at four bits occupy 3.5 billion bytes before metadata and other allocations. That is about 3.26 GiB. It is not a complete estimate of whether a seven-billion-parameter training job fits on a particular device.&lt;/p&gt;

&lt;p&gt;Sequence length and microbatch size can change the activation budget dramatically. Measure representative long sequences, not just a batch of short examples. Keep memory headroom for evaluation and checkpoint operations, which may follow different allocation paths from steady-state training.&lt;/p&gt;

&lt;p&gt;Record allocated and reserved memory as different observations. A framework allocator retaining memory is not automatically a leak; growth across repeated identical steps deserves investigation.&lt;/p&gt;

&lt;h2 id=&quot;choose-adapter-placement-with-an-experiment&quot;&gt;Choose adapter placement with an experiment&lt;/h2&gt;

&lt;p&gt;Identify the modules receiving adapters and verify that their names match the actual model architecture. A configuration copied from another model can target the wrong components or none at all.&lt;/p&gt;

&lt;p&gt;Print the trainable parameter count and inspect several named parameters. Confirm that base weights are frozen and intended adapter weights receive gradients. Run a tiny update and check that adapter values actually change.&lt;/p&gt;

&lt;p&gt;Treat rank, scaling, dropout, and target modules as experimental choices. A higher rank increases flexibility and cost, but improvement is task dependent. Compare a small number of justified configurations under the same data and evaluation budget before expanding the search.&lt;/p&gt;

&lt;p&gt;Keep a full fine-tuning comparison only when resources and the project question warrant it. The useful decision is whether the adapter meets the task requirement, not whether one method wins every possible benchmark.&lt;/p&gt;

&lt;h2 id=&quot;verify-tokenization-and-loss-masking&quot;&gt;Verify tokenization and loss masking&lt;/h2&gt;

&lt;p&gt;Inspect decoded examples after the complete formatting path. Confirm role markers, separators, end tokens, truncation behavior, and which tokens contribute to the loss. A plausible-looking text file can become a very different training sequence after templating.&lt;/p&gt;

&lt;p&gt;For supervised response training, decide whether the task should train on prompt tokens, response tokens, or another explicit span. Verify masks numerically and visually on a few examples. An answer truncated away by the maximum length can leave a record with no useful supervised target.&lt;/p&gt;

&lt;p&gt;If packing multiple examples into a sequence, verify boundary and attention behavior for the implementation in use. Count useful supervised tokens as well as total processed tokens. Otherwise padding or masked prompt text can make a throughput result look more productive than it is.&lt;/p&gt;

&lt;p&gt;Use validation examples from sources not represented by near duplicates in training. Adapter efficiency does not protect against data leakage.&lt;/p&gt;

&lt;h2 id=&quot;tune-the-optimizer-using-measured-behavior&quot;&gt;Tune the optimizer using measured behavior&lt;/h2&gt;

&lt;p&gt;Start with a conservative task-appropriate configuration and a short run. Track training loss, held-out quality, gradient behavior, and output examples. A decreasing training loss is not sufficient evidence of useful adaptation.&lt;/p&gt;

&lt;p&gt;Gradient accumulation increases the effective batch without requiring the same activation memory as a single larger microbatch, but the run still needs to preserve the intended loss normalization and update schedule. Record both microbatch size and effective batch size.&lt;/p&gt;

&lt;p&gt;Activation checkpointing trades recomputation for memory. Offloading trades device pressure for host memory and transfer cost. Paged optimizer behavior can depend on memory pressure. Measure these choices on the intended hardware instead of assuming a configuration that fits will also train efficiently.&lt;/p&gt;

&lt;h2 id=&quot;save-a-reproducible-adapter-bundle&quot;&gt;Save a reproducible adapter bundle&lt;/h2&gt;

&lt;p&gt;An adapter needs the exact compatible base revision, tokenizer, formatting template, adapter configuration, and runtime assumptions. Preserve those identifiers with the adapter weights. A base model family name does not identify a particular set of parameters.&lt;/p&gt;

&lt;p&gt;For training continuation, retain optimizer and scheduler state in addition to the adapter. For deployment, retain the input contract and generation settings used during evaluation. Distinguish these two purposes so that a minimal serving export is not mistaken for a resumable checkpoint.&lt;/p&gt;

&lt;p&gt;Hash important artifacts and test loading them in a clean environment. Document any custom code required by the loader and review it as executable software.&lt;/p&gt;

&lt;h2 id=&quot;evaluate-the-serving-representation-separately&quot;&gt;Evaluate the serving representation separately&lt;/h2&gt;

&lt;p&gt;Serving with an adapter, merging into higher-precision base weights, and quantizing a merged model are different artifact paths. Numerical behavior and runtime support can differ. Validate the final path using held-out task cases, general regression cases, long inputs, and invalid-input handling.&lt;/p&gt;

&lt;p&gt;Measure quality and latency together. If a merged version removes adapter overhead but damages a critical slice after quantization, a smaller file is not sufficient justification for promotion.&lt;/p&gt;

&lt;p&gt;Publish a result with base revision, adapter placement, rank, data version, supervised-token policy, context length, hardware, peak memory, runtime, and evaluation outcome. Such a record tells another engineer what was demonstrated. “Fine-tunes on one GPU” leaves almost every important condition unstated.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>NFS security: root squashing does not authenticate every user</title>
    <link href="https://www.wirewalk.com/writing/nfs-auth-sys-kerberos-boundaries/"/>
    <published>2025-03-27T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/nfs-auth-sys-kerberos-boundaries/</id>
    <summary>Client trust, user identity, integrity, and encryption are separate choices in an NFS design.</summary>
    <content type="html">&lt;p&gt;Limiting an NFS export to a trusted subnet says which machines may connect. It does not settle how much authority those clients have to identify their users. Establish that trust relationship before trying to repair access with filesystem permissions.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-the-security-flavors&quot;&gt;Distinguish the security flavors&lt;/h2&gt;

&lt;p&gt;The Linux NFS export manual documents &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sec=sys&lt;/code&gt; and Kerberos flavors. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;krb5&lt;/code&gt; provides Kerberos authentication, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;krb5i&lt;/code&gt; adds integrity, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;krb5p&lt;/code&gt; adds privacy. It also documents root squashing, which maps client root requests to an anonymous identity rather than treating them as server root. See &lt;a href=&quot;https://man7.org/linux/man-pages/man5/exports.5.html&quot;&gt;exports(5)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Root squashing does not turn client-supplied AUTH_SYS user IDs into independently authenticated identities. That matters when a client is shared, unmanaged, or compromised. Evaluate the trustworthiness of the client host as part of the export’s security boundary.&lt;/p&gt;

&lt;h2 id=&quot;inspect-what-the-client-actually-mounted&quot;&gt;Inspect what the client actually mounted&lt;/h2&gt;

&lt;p&gt;On a Linux NFS client:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;findmnt &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; nfs,nfs4
nfsstat &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;id
&lt;/span&gt;klist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The last command requires Kerberos client tools and reports the current ticket context. Its absence does not diagnose the server. Compare negotiated mount options with server export settings and the application’s actual execution identity.&lt;/p&gt;

&lt;p&gt;Do not assume that an entry in a proposed mount configuration describes an already established mount. Inspect the running system.&lt;/p&gt;

&lt;h2 id=&quot;test-identities-not-just-connectivity&quot;&gt;Test identities, not just connectivity&lt;/h2&gt;

&lt;p&gt;Use a dedicated export with synthetic files. Test an authorized user, an unrelated user, and a client root process. Define which read, create, rename, and permission-changing operations should succeed before running the test.&lt;/p&gt;

&lt;p&gt;If Kerberos is required, include a fresh session without a usable ticket and a session with the intended credentials. Long-running jobs need a documented credential-lifetime strategy. A successful interactive mount does not prove a batch job will continue working several hours later.&lt;/p&gt;

&lt;p&gt;Evaluate directory permissions as well as file permissions. A user may be unable to alter file contents but still be allowed to rename or remove a directory entry.&lt;/p&gt;

&lt;h2 id=&quot;treat-migration-as-an-interoperability-test&quot;&gt;Treat migration as an interoperability test&lt;/h2&gt;

&lt;p&gt;VAST, PowerScale, WEKA, and Linux NFS servers do not expose identical configuration interfaces. Check the supported security flavors, release constraints, identity integration, and client requirements for each platform. Do not paste Linux &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/exports&lt;/code&gt; syntax into an appliance runbook.&lt;/p&gt;

&lt;p&gt;Kerberos introduces dependencies on time, name resolution, principals, and key distribution. Benchmark the application’s real workload with the required security settings rather than disabling privacy to obtain a more attractive throughput number.&lt;/p&gt;

&lt;h2 id=&quot;acceptance-criteria&quot;&gt;Acceptance criteria&lt;/h2&gt;

&lt;p&gt;Keep the negotiated security flavor and test identity with the results for each allowed and denied operation. Include a long-running job so credential renewal is exercised too. Document residual client trust explicitly when AUTH_SYS remains necessary. Network segmentation and managed clients can reduce exposure, but they should not be described as cryptographic user authentication.&lt;/p&gt;

&lt;p&gt;Related: &lt;a href=&quot;/writing/powerscale-multiprotocol-identity-acls/&quot;&gt;PowerScale multiprotocol identities&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Replication and failback: choose a clean recovery point before reversing direction</title>
    <link href="https://www.wirewalk.com/writing/replication-failback-clean-recovery/"/>
    <published>2025-03-03T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/replication-failback-clean-recovery/</id>
    <summary>Remote availability, historical recovery, and returning service to the primary site require separate decisions.</summary>
    <content type="html">&lt;p&gt;Replication carries deletions and corruption as faithfully as useful updates. Before promoting a remote copy, establish whether you are recovering from a failed site, damaged data or a compromised administrator. Each calls for a different recovery point and a different level of trust in the replica.&lt;/p&gt;

&lt;h2 id=&quot;classify-the-event-before-promotion&quot;&gt;Classify the event before promotion&lt;/h2&gt;

&lt;p&gt;A failed primary site, a deleted directory, and a compromised administrator require different decisions. Site failure may justify promoting the latest consistent replica. Corruption may require an older recovery point. Compromise also requires deciding whether identities, configuration, and the destination remain trustworthy.&lt;/p&gt;

&lt;p&gt;Write the intended decision path before the incident:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Event&lt;/th&gt;
      &lt;th&gt;First recovery question&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Hardware or site outage&lt;/td&gt;
      &lt;td&gt;Is the latest replica complete and usable?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Accidental change&lt;/td&gt;
      &lt;td&gt;Which earlier point contains the required data?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Suspected compromise&lt;/td&gt;
      &lt;td&gt;Which point and administrative boundary can be trusted?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Return to primary&lt;/td&gt;
      &lt;td&gt;Which site now owns authoritative writes?&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;These are operating decisions. The replication engine cannot infer them from a successful transfer.&lt;/p&gt;

&lt;h2 id=&quot;make-authority-explicit&quot;&gt;Make authority explicit&lt;/h2&gt;

&lt;p&gt;A promotion procedure should identify who can stop writes, declare the source fenced, select the recovery point, and open the destination to applications. Include the behavior of clients with stale connections and old DNS answers.&lt;/p&gt;

&lt;p&gt;For PowerScale SyncIQ with SmartLock, use Dell’s documented source/target and failback constraints. The &lt;a href=&quot;https://www.dell.com/support/manuals/en-us/isilon-onefs/ifs_pub_backup_and_recovery_guide_9.9.0.0/smartlock-replication-limitations?guid=guid-250c03c8-56b7-41c9-b418-7ec149ed2cbc&quot;&gt;OneFS replication limitations&lt;/a&gt; demonstrate why a generic “reverse replication” step is inadequate. Other platforms require their own supported workflow.&lt;/p&gt;

&lt;h2 id=&quot;rehearse-the-full-round-trip&quot;&gt;Rehearse the full round trip&lt;/h2&gt;

&lt;p&gt;In an isolated environment, create a baseline dataset, replicate it, and record checksums. Simulate source unavailability without deleting the source. Promote through the supported procedure, make a controlled change at the recovery site, and confirm that only the intended site accepts writes.&lt;/p&gt;

&lt;p&gt;Now rehearse the return. Preserve the destination’s new data, re-establish the intended relationship, and confirm which copy wins. A test ending immediately after promotion misses the part that can overwrite valid recovery-site work.&lt;/p&gt;

&lt;h2 id=&quot;measure-application-consequences&quot;&gt;Measure application consequences&lt;/h2&gt;

&lt;p&gt;Time the last accepted source write, recovery-point availability, promotion, application readiness, and return to steady operation. Record any accepted data loss against the service’s agreed recovery-point objective. Measure user-visible downtime against the recovery-time objective.&lt;/p&gt;

&lt;p&gt;Use the same credentials and network routes expected during an actual outage, except where the lab intentionally substitutes test identities. If a privileged engineer manually repaired five undocumented dependencies, those are findings, not a passing automated recovery.&lt;/p&gt;

&lt;h2 id=&quot;keep-history-outside-the-propagation-path&quot;&gt;Keep history outside the propagation path&lt;/h2&gt;

&lt;p&gt;Maintain a recovery strategy that can survive harmful changes being replicated. That may include protected historical copies and separate administrative authority, selected for the product and threat model. Document the retention window and the maximum time the business expects to take to detect corruption.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;/writing/recovery-after-admin-compromise/&quot;&gt;administrator-compromise recovery&lt;/a&gt; for the authority review that complements the data path.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>RAG or fine-tuning: what each choice demands from NVIDIA infrastructure</title>
    <link href="https://www.wirewalk.com/writing/rag-fine-tuning-pretraining-decision/"/>
    <published>2025-02-19T10:00:00-05:00</published>
    <updated>2025-02-19T10:00:00-05:00</updated>
    <id>https://www.wirewalk.com/writing/rag-fine-tuning-pretraining-decision/</id>
    <summary>Compare retrieval, adaptation, and pretraining by GPU residency, serving topology, storage traffic, training allocations, interconnect requirements, and the failure each approach can actually repair.</summary>
    <content type="html">&lt;p&gt;When an AI system gives poor answers, adding retrieval and retraining the model solve different problems. They also place different demands on the infrastructure. Retrieval needs a maintained data and query path; adaptation needs GPU jobs and versioned datasets; large pretraining needs sustained distributed capacity and substantial checkpoint storage.&lt;/p&gt;

&lt;p&gt;Find the failure first, then cost the complete NVIDIA platform needed to address it. Compare answer quality alongside GPU residency, storage, networking and the work of keeping the system recoverable.&lt;/p&gt;

&lt;h2 id=&quot;draw-the-resource-topology-before-choosing-the-technique&quot;&gt;Draw the resource topology before choosing the technique&lt;/h2&gt;

&lt;p&gt;A retrieval-based service can have separate parsing, embedding, indexing, reranking, and generation stages. Some stages may use NVIDIA GPUs; others may remain CPU- or storage-bound. Map their owners, placement, memory, and peak rates separately. Scaling generation replicas does not repair an index whose refresh process cannot keep up.&lt;/p&gt;

&lt;p&gt;Estimate embedding refresh traffic from changed content, not only total corpus size. Include temporary index copies, metadata, authorization data, and the time needed to retire an old index safely. Measure whether embedding jobs compete with interactive requests for the same device or storage path.&lt;/p&gt;

&lt;p&gt;A fine-tuning path adds its own dataset snapshots, training allocation, checkpoints, and validation service. A distributed pretraining path adds topology constraints: several GPUs merely available somewhere in a cluster are not equivalent to a suitable connected allocation.&lt;/p&gt;

&lt;h2 id=&quot;assign-nvidia-software-to-a-specific-stage&quot;&gt;Assign NVIDIA software to a specific stage&lt;/h2&gt;

&lt;p&gt;Triton is a candidate service layer for supported embedding, reranking, or generation backends; it is not a retrieval index or an authorization system. Its &lt;a href=&quot;https://raw.githubusercontent.com/triton-inference-server/server/r24.04/docs/user_guide/model_configuration.md&quot;&gt;24.04 model configuration reference&lt;/a&gt; describes backend, tensor, batch, and instance configuration. Qualify each stage’s supported shapes and memory demand, then qualify their combined request path.&lt;/p&gt;

&lt;p&gt;TensorRT and &lt;a href=&quot;https://raw.githubusercontent.com/NVIDIA/TensorRT-LLM/v0.8.0/README.md&quot;&gt;TensorRT-LLM&lt;/a&gt; provide distinct deployment entry points for suitable supported models. Establish model, operator, precision, and runtime compatibility before budgeting gains. The &lt;a href=&quot;https://raw.githubusercontent.com/NVIDIA/TensorRT/release/8.6/README.md&quot;&gt;TensorRT 8.6 OSS documentation&lt;/a&gt; illustrates that deployment depends on a specific software stack and that the OSS repository represents only part of the full release. It does not imply every checkpoint converts without additional work.&lt;/p&gt;

&lt;p&gt;For a hypothetical design, keep the generator resident on its allocated GPU while batching embedding refresh work elsewhere. Compare that separation against co-location under the real latency objective. Include cache memory and a replica failure. If the model does not fit with the required concurrency, first revisit the model, precision, context policy, and admitted workload; adding a multi-GPU dependency is a substantial infrastructure decision.&lt;/p&gt;

&lt;h2 id=&quot;separate-knowledge-access-from-learned-behavior&quot;&gt;Separate knowledge access from learned behavior&lt;/h2&gt;

&lt;p&gt;Consider an illustrative assistant that answers questions about equipment procedures. A procedure changes frequently, and the model gives an old torque specification. The first question is whether the correct procedure was available to the answer-generation step.&lt;/p&gt;

&lt;p&gt;If retrieval returned an obsolete revision, changing the generator weights does not repair document lifecycle management. If retrieval returned the right revision but omitted the relevant table, inspect parsing and chunking. If the necessary table was visible and the answer still ignored it, investigate instruction following, reasoning, and output validation.&lt;/p&gt;

&lt;p&gt;A different failure is consistent use of the wrong response format or inability to perform a domain-specific transformation. More documents may not solve that behavior. Supervised examples and a suitable adaptation method may be a better experiment.&lt;/p&gt;

&lt;h2 id=&quot;use-retrieval-when-evidence-should-remain-external&quot;&gt;Use retrieval when evidence should remain external&lt;/h2&gt;

&lt;p&gt;Retrieval-augmented generation supplies relevant material at answer time. The &lt;a href=&quot;https://arxiv.org/abs/2005.11401&quot;&gt;original RAG paper, submitted in May 2020&lt;/a&gt;, combined a parametric generator with a dense index. Enterprise implementations can differ substantially from that research architecture; the common design concern is how external evidence reaches generation.&lt;/p&gt;

&lt;p&gt;External evidence is attractive when facts change, when an answer needs traceable sources, or when different users are entitled to different documents. It also creates responsibilities: ingestion, parsing, indexing, revision selection, access enforcement, and deletion propagation.&lt;/p&gt;

&lt;p&gt;Enforce authorization before protected text reaches generation, and avoid caches that cross user permission boundaries. A citation is not an access control. An instruction telling a model to ignore unauthorized material is not a substitute for keeping that material out of the request.&lt;/p&gt;

&lt;h2 id=&quot;evaluate-retrieval-independently&quot;&gt;Evaluate retrieval independently&lt;/h2&gt;

&lt;p&gt;Build a query set with known relevant evidence. Measure whether the retrieval stage finds that evidence and whether the returned version is valid for the question’s date and user. Inspect lexical search, vector search, and any reranking separately when they are components of the system.&lt;/p&gt;

&lt;p&gt;Test difficult document structures: tables, repeated headers, attachments, scans, superseded procedures, and references spanning sections. Chunk size should follow the information needed to answer, not a universal number of tokens.&lt;/p&gt;

&lt;p&gt;Then evaluate generation with the correct evidence supplied directly. If quality remains poor under this controlled condition, search tuning alone will not close the gap. Conversely, if generation succeeds with correct evidence but the end-to-end system fails, focus the next experiment on retrieval and orchestration.&lt;/p&gt;

&lt;h2 id=&quot;fine-tune-for-a-measurable-behavior-change&quot;&gt;Fine-tune for a measurable behavior change&lt;/h2&gt;

&lt;p&gt;Supervised fine-tuning adjusts a pretrained model using task examples. Good candidates include a repeatable extraction format, a specialized transformation, or consistent application of a rubric that the base model does not follow reliably.&lt;/p&gt;

&lt;p&gt;Prepare examples with clear target behavior and representative edge cases. Separate training data from evaluation by source or entity where needed. Audit generated training examples instead of assuming synthetic volume produces correct supervision.&lt;/p&gt;

&lt;p&gt;Keep a base-model comparison and evaluate general capability as well as task-specific gains. A fine-tuned model can improve one workflow while becoming less reliable on others. If the application needs broad behavior, preserve regression tests for that behavior.&lt;/p&gt;

&lt;p&gt;Do not treat a fine-tuned checkpoint as a reliable database of changing facts. Learned associations can be difficult to update or remove precisely, and a model may still invent unsupported details. Retrieval and fine-tuning can be combined when their roles are independently justified.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-continued-pretraining-from-supervised-adaptation&quot;&gt;Distinguish continued pretraining from supervised adaptation&lt;/h2&gt;

&lt;p&gt;Continued pretraining uses a general prediction objective on additional domain material. It may help when the underlying language or domain distribution is poorly represented, but it requires a careful corpus policy, compute budget, and evaluation plan. It is not interchangeable with teaching a small set of preferred answer examples.&lt;/p&gt;

&lt;p&gt;Training from scratch is a larger decision still. It introduces tokenizer design, corpus acquisition and filtering, long-running distributed optimization, checkpoint recovery, and broad capability evaluation. Possessing a large document collection does not establish that this path is economical or that the rights and quality of the collection are suitable.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://arxiv.org/abs/1706.03762&quot;&gt;2017 Transformer paper&lt;/a&gt; establishes the architecture’s historical foundation. It does not supply a business case for building a new foundation model. That case needs evidence that adaptation and existing models cannot satisfy the actual requirement.&lt;/p&gt;

&lt;h2 id=&quot;compare-complete-systems-under-a-fixed-task&quot;&gt;Compare complete systems under a fixed task&lt;/h2&gt;

&lt;p&gt;Use a controlled comparison that includes the same accepted outputs, data boundary, and failure policy. One candidate may combine a smaller model with better retrieval; another may use a larger adapted model. Measure their full behavior, rather than attributing the result solely to parameter count.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Observed failure&lt;/th&gt;
      &lt;th&gt;First controlled experiment&lt;/th&gt;
      &lt;th&gt;Evidence needed before expanding scope&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Correct source never retrieved&lt;/td&gt;
      &lt;td&gt;Supply the source directly&lt;/td&gt;
      &lt;td&gt;Generator succeeds with sufficient evidence&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Wrong document revision&lt;/td&gt;
      &lt;td&gt;Repair version filtering&lt;/td&gt;
      &lt;td&gt;Queries select the valid revision consistently&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Output schema repeatedly wrong&lt;/td&gt;
      &lt;td&gt;Validate and test supervised adaptation&lt;/td&gt;
      &lt;td&gt;Reduced repair rate on held-out inputs&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Domain language poorly understood&lt;/td&gt;
      &lt;td&gt;Compare domain-adapted candidates&lt;/td&gt;
      &lt;td&gt;Improvement beyond retrieval and prompting&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Broad capability absent&lt;/td&gt;
      &lt;td&gt;Compare stronger base models&lt;/td&gt;
      &lt;td&gt;A demonstrated task gap with feasible alternatives&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;These are diagnostic suggestions, not guarantees about which technique will win.&lt;/p&gt;

&lt;h2 id=&quot;account-for-operational-consequences&quot;&gt;Account for operational consequences&lt;/h2&gt;

&lt;p&gt;Retrieval adds ingestion and query-time dependencies. Fine-tuning adds dataset management, training, and per-version evaluation. Continued pretraining adds much larger compute and corpus obligations. All paths require serving, monitoring, and recovery.&lt;/p&gt;

&lt;p&gt;Measure end-to-end latency, indexing freshness, access correctness, answer quality, and operator workload. A cheap generator with a complicated retrieval path may cost more to operate than a simpler alternative. A highly accurate fine-tune may be unsuitable if its training data cannot be maintained.&lt;/p&gt;

&lt;p&gt;Choose the smallest intervention that resolves a demonstrated failure and survives the acceptance tests. Keep the cases that exposed the original failure. Rerunning them after a model or data change is the quickest way to see whether that problem was actually fixed.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>S3 Object Lock: test versions, not just object names</title>
    <link href="https://www.wirewalk.com/writing/s3-object-lock-version-aware-recovery/"/>
    <published>2025-02-07T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/s3-object-lock-version-aware-recovery/</id>
    <summary>A delete marker can hide a protected version. Recovery tooling must know which version it needs.</summary>
    <content type="html">&lt;p&gt;An S3 object can disappear from a normal listing while a protected version remains intact. The reverse mistake is just as costly: seeing Object Lock enabled on a bucket and assuming every version has the required retention. Inspect and retrieve the specific versions the recovery plan depends on.&lt;/p&gt;

&lt;h2 id=&quot;understand-the-unit-of-protection&quot;&gt;Understand the unit of protection&lt;/h2&gt;

&lt;p&gt;Amazon S3 Object Lock applies to object versions. AWS documents governance and compliance retention modes, along with legal holds. A new version or a delete marker can exist above a protected version. Governance bypass requires specific authority and a bypass request; compliance retention has a different boundary. See &lt;a href=&quot;https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html&quot;&gt;AWS Object Lock documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These are Amazon S3 semantics. An S3-compatible product needs its own compatibility review. Do not assume identical retention behavior because both systems accept an S3 client.&lt;/p&gt;

&lt;h2 id=&quot;inspect-a-known-test-object&quot;&gt;Inspect a known test object&lt;/h2&gt;

&lt;p&gt;With AWS CLI installed and a read-only role authorized for a dedicated lab bucket, replace the example names and version identifier:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws s3api get-object-lock-configuration &lt;span class=&quot;nt&quot;&gt;--bucket&lt;/span&gt; example-recovery-lab
aws s3api list-object-versions &lt;span class=&quot;nt&quot;&gt;--bucket&lt;/span&gt; example-recovery-lab &lt;span class=&quot;nt&quot;&gt;--prefix&lt;/span&gt; test.txt
aws s3api get-object-retention &lt;span class=&quot;nt&quot;&gt;--bucket&lt;/span&gt; example-recovery-lab &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--key&lt;/span&gt; test.txt &lt;span class=&quot;nt&quot;&gt;--version-id&lt;/span&gt; EXAMPLE_VERSION_ID
aws s3api get-object-legal-hold &lt;span class=&quot;nt&quot;&gt;--bucket&lt;/span&gt; example-recovery-lab &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--key&lt;/span&gt; test.txt &lt;span class=&quot;nt&quot;&gt;--version-id&lt;/span&gt; EXAMPLE_VERSION_ID
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Capture the exact version ID. An access-denied response means the inspection is incomplete; it does not mean retention is absent. Likewise, a bucket default is not a substitute for examining the version you intend to recover.&lt;/p&gt;

&lt;h2 id=&quot;design-positive-and-negative-tests&quot;&gt;Design positive and negative tests&lt;/h2&gt;

&lt;p&gt;Upload synthetic data under an approved short test retention. Confirm that the protected version cannot be permanently removed by the ordinary application role. Test any governance-bypass role separately, with a disposable object and an explicit expected result.&lt;/p&gt;

&lt;p&gt;Then verify that the recovery role can retrieve the intended historical version even when it is no longer the current one. Compare its content against a local test checksum. Do not perform these deletion exercises against actual backup objects.&lt;/p&gt;

&lt;h2 id=&quot;preserve-the-other-dependencies&quot;&gt;Preserve the other dependencies&lt;/h2&gt;

&lt;p&gt;Object retention does not preserve an application’s encryption keys, restore catalog, account access, or business knowledge about which point is clean. Keep those in the recovery design. A backup system should also document its required permissions and supported bucket configuration before retention is enforced.&lt;/p&gt;

&lt;p&gt;Monitor failed writes, cleanup failures, and capacity growth after rollout. Protection that interferes with a backup product’s lifecycle can create a different outage while appearing to improve security.&lt;/p&gt;

&lt;h2 id=&quot;evidence-that-answers-the-question&quot;&gt;Evidence that answers the question&lt;/h2&gt;

&lt;p&gt;Keep the bucket configuration, protected version ID, retention state and tested identities with the results of the deletion-denial and retrieval tests. “Object Lock enabled” is only one line in that report.&lt;/p&gt;

&lt;p&gt;Compare this model with &lt;a href=&quot;/writing/powerscale-smartlock-replication-retention/&quot;&gt;PowerScale SmartLock&lt;/a&gt;; the two are related design problems, not interchangeable implementations.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>WEKA encryption: include the key service in the recovery plan</title>
    <link href="https://www.wirewalk.com/writing/weka-encryption-kms-recovery/"/>
    <published>2025-01-14T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/weka-encryption-kms-recovery/</id>
    <summary>Encrypted data and recoverable data are different outcomes. Test the key dependency without risking production keys.</summary>
    <content type="html">&lt;p&gt;A storage cluster can be healthy and its data inaccessible because the recovery environment cannot reach the key-management service. Include KMS authentication, certificates and key availability in the recovery plan, alongside the storage and network dependencies.&lt;/p&gt;

&lt;h2 id=&quot;establish-the-release-and-encryption-state&quot;&gt;Establish the release and encryption state&lt;/h2&gt;

&lt;p&gt;The WEKA 4.2 documentation describes an external KMS for encrypted filesystems and documents the read-only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;weka security kms&lt;/code&gt; command. It identifies Vault and KMIP integrations; support details must be checked against the deployed release. See &lt;a href=&quot;https://docs.weka.io/4.2/usage/security&quot;&gt;security management&lt;/a&gt; and &lt;a href=&quot;https://docs.weka.io/4.2/getting-started-with-weka/weka-rest-api-and-equivalent-cli-commands&quot;&gt;the API/CLI reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On an authorized management host with the matching WEKA CLI, inspect:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;weka version
weka fs
weka security kms
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These are inventory commands, not a recovery test. Treat their output as sensitive configuration information and store it accordingly.&lt;/p&gt;

&lt;h2 id=&quot;draw-the-boot-and-recovery-order&quot;&gt;Draw the boot and recovery order&lt;/h2&gt;

&lt;p&gt;Record how the KMS itself starts after a site outage. Identify its storage, DNS, certificates, authentication backend, and recovery custodians. If those services depend entirely on the encrypted filesystem, there is a circular dependency to resolve.&lt;/p&gt;

&lt;p&gt;A recovery worksheet should include the filesystem, KMS endpoint, key identifier, trusted CA, authentication method, supported recovery procedure, and owner. It should not contain private keys, tokens, or unseal material.&lt;/p&gt;

&lt;p&gt;Decide which copies of configuration can be held in an emergency package and which secrets require separate custodians. An offline document that says “log into the vault” is incomplete if the vault is what failed.&lt;/p&gt;

&lt;h2 id=&quot;use-a-lab-to-test-key-service-loss&quot;&gt;Use a lab to test key-service loss&lt;/h2&gt;

&lt;p&gt;Create a disposable encrypted filesystem with a test key and representative data. Establish a baseline read and recovery operation. Under the vendor’s supported test procedure, simulate KMS unavailability in the lab and observe existing access, new mounts, and recovery behavior separately.&lt;/p&gt;

&lt;p&gt;Do not infer one behavior from another. Cached key material and lifecycle operations can create different dependencies. Do not delete or disable production keys to see what happens.&lt;/p&gt;

&lt;p&gt;Restore the lab KMS path and repeat the original operation. Record any manual steps, certificate failures, authentication changes, and elapsed time. The result should identify which operations require the KMS, not simply whether the cluster stayed up.&lt;/p&gt;

&lt;h2 id=&quot;separate-key-rotation-from-data-movement&quot;&gt;Separate key rotation from data movement&lt;/h2&gt;

&lt;p&gt;Key rewrapping, key replacement, and bulk data re-encryption are not interchangeable terms. Use the release-specific workflow and inspect the resulting configuration. A successful rotation task should be followed by access and recovery tests using the intended recovery environment.&lt;/p&gt;

&lt;p&gt;Test that authorized workloads can use the protected data from the recovery environment, while unauthorized identities remain excluded. Repeat with the normal site unavailable. See &lt;a href=&quot;/writing/weka-snap-to-object-recovery/&quot;&gt;Snap-To-Object recovery&lt;/a&gt; for the associated data-side exercise.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>WEKA Snap-To-Object: prove recovery without the source cluster</title>
    <link href="https://www.wirewalk.com/writing/weka-snap-to-object-recovery/"/>
    <published>2024-12-21T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/weka-snap-to-object-recovery/</id>
    <summary>A completed upload is a milestone. Recovery also needs the locator, compatible software, credentials, and usable application data.</summary>
    <content type="html">&lt;p&gt;If the source WEKA cluster is unavailable, can you still recover the data? A snapshot listed on that cluster does not answer the question. Snap-To-Object can support an independent recovery path, but that path needs its own test.&lt;/p&gt;

&lt;h2 id=&quot;identify-the-recovery-artifacts&quot;&gt;Identify the recovery artifacts&lt;/h2&gt;

&lt;p&gt;WEKA documents Snap-To-Object as storing snapshot data and filesystem metadata in an object store, with a reference locator used for recovery. Its documentation specifies recovery to the same or a higher WEKA version and describes interactions with tiering. See &lt;a href=&quot;https://docs.weka.io/weka-filesystems-and-object-stores/snap-to-obj&quot;&gt;Snap-To-Object&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Record the snapshot identity, successful upload state, locator, destination bucket, source release, and intended recovery release. Keep recovery credentials and encryption material in their approved secret-management systems, not in the inventory document.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.weka.io/weka-filesystems-and-object-stores/snapshots&quot;&gt;snapshot documentation&lt;/a&gt; distinguishes local history from external backup. Use that distinction in monitoring labels so operators do not mistake snapshot creation for off-cluster completion.&lt;/p&gt;

&lt;h2 id=&quot;rehearse-with-an-independent-destination&quot;&gt;Rehearse with an independent destination&lt;/h2&gt;

&lt;p&gt;Prepare a small filesystem containing several large files, many small files, nested directories, and representative permission settings. Generate a manifest of expected paths and checksums before taking the snapshot. Use synthetic data if the recovery environment has a different security boundary.&lt;/p&gt;

&lt;p&gt;Upload through the supported workflow and confirm completion. Recover using the documented locator on a separate test cluster with an explicitly compatible release. The exercise should not need to query the original cluster for an undocumented missing value.&lt;/p&gt;

&lt;p&gt;Check the recovered namespace, read files throughout the tree, and compare checksums and ownership. Then run an application-level test. Being able to list filenames does not prove the backing data is available or that a workload can use it.&lt;/p&gt;

&lt;h2 id=&quot;include-object-store-failure-modes&quot;&gt;Include object-store failure modes&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Dependency&lt;/th&gt;
      &lt;th&gt;Test question&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Bucket access&lt;/td&gt;
      &lt;td&gt;Does the recovery identity have exactly the required access?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Encryption&lt;/td&gt;
      &lt;td&gt;Can the recovery environment obtain the necessary keys?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Locator&lt;/td&gt;
      &lt;td&gt;Is it retained independently of the failed cluster?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Lifecycle&lt;/td&gt;
      &lt;td&gt;Could object expiration remove required data?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Network&lt;/td&gt;
      &lt;td&gt;Is recovery throughput adequate across the actual route?&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Do not add object-lock or lifecycle settings to an active WEKA bucket by analogy with a generic backup product. Confirm compatibility with the WEKA release and workflow, including cleanup and tiering behavior, before making retention changes.&lt;/p&gt;

&lt;h2 id=&quot;measure-usable-recovery&quot;&gt;Measure usable recovery&lt;/h2&gt;

&lt;p&gt;Track when the filesystem becomes available and when representative reads finish. Data or metadata fetched on demand can make initial availability look much better than workload recovery. Measure the first full working-set access separately from a later warm-cache run.&lt;/p&gt;

&lt;p&gt;Retain the completed-upload evidence, recovery release, manifest comparison, and application results. Those results show what can actually be recovered and how long it takes. Keep them beside the upload schedule so an operator can tell which recovery path has been exercised.&lt;/p&gt;

&lt;p&gt;Continue with &lt;a href=&quot;/writing/weka-encryption-kms-recovery/&quot;&gt;WEKA and KMS recovery&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Retraining on a shared NVIDIA cluster: GPU budgets, scheduling, and safe promotion</title>
    <link href="https://www.wirewalk.com/writing/retraining-drift-labels-promotion/"/>
    <published>2024-12-11T10:00:00-05:00</published>
    <updated>2024-12-11T10:00:00-05:00</updated>
    <id>https://www.wirewalk.com/writing/retraining-drift-labels-promotion/</id>
    <summary>Plan retraining as an infrastructure workload with measured GPU-hour budgets, queue limits, data staging, checkpoint recovery, interference controls, and compatible serving promotion.</summary>
    <content type="html">&lt;p&gt;A nightly retraining job can finish on time and still cause trouble for everyone sharing the GPU platform. It may collide with inference, compete with research jobs for storage bandwidth or leave no room for retries. Decide how much capacity the recurring work is allowed to consume before putting it on a schedule.&lt;/p&gt;

&lt;p&gt;Then connect each run to a reason for retraining, an interruption plan and a decision about promotion. Producing weights more often is worthwhile when the service improves enough to justify the compute and operator time.&lt;/p&gt;

&lt;h2 id=&quot;turn-the-retraining-policy-into-an-allocation-budget&quot;&gt;Turn the retraining policy into an allocation budget&lt;/h2&gt;

&lt;p&gt;Estimate preprocessing, training, validation, checkpointing, and artifact transfer separately. Multiply measured run time by allocated GPU count to obtain allocated GPU-hours, then record useful throughput and the achieved quality. GPU-hours describe resource consumption; they do not establish the amount of useful model work.&lt;/p&gt;

&lt;p&gt;For illustration, four GPUs allocated for six hours consume 24 GPU-hours. Running that job every day reserves 720 GPU-hours in a thirty-day month, before retries and validation. A shared cluster needs a queue policy and a capacity decision for that obligation, rather than an unbounded cron job.&lt;/p&gt;

&lt;p&gt;Use scheduler limits for concurrent retraining runs, maximum wall time, and scratch consumption. Decide whether interrupted jobs resume, restart, or wait for the next data window. A preemptible allocation is economical only if checkpoint and restart behavior preserve enough useful progress.&lt;/p&gt;

&lt;h2 id=&quot;isolate-training-pressure-from-inference-deadlines&quot;&gt;Isolate training pressure from inference deadlines&lt;/h2&gt;

&lt;p&gt;Where training and serving share NVIDIA nodes, test interference explicitly. Separate device allocations do not eliminate contention for host RAM, CPU, PCIe, NICs, or shared storage. Keep latency-sensitive serving capacity reserved when its deadline requires that separation.&lt;/p&gt;

&lt;p&gt;Use NVIDIA DCGM for device-health and activity observations alongside scheduler accounting and application progress. The &lt;a href=&quot;https://docs.nvidia.com/datacenter/dcgm/2.3/dcgm-user-guide/feature-overview.html&quot;&gt;DCGM 2.3 feature overview&lt;/a&gt; documents monitoring and profiling capabilities available before this article’s date. Counter availability depends on hardware and configuration; a missing metric is not evidence of zero activity.&lt;/p&gt;

&lt;p&gt;Check whether a supposed drift event coincides with a driver change, a changed container, thermal limiting, or a degraded input path. Those conditions can alter throughput or serving outcomes without creating a useful reason to learn new weights.&lt;/p&gt;

&lt;p&gt;Reserve promotion capacity as well. Loading a challenger beside a champion can temporarily require two model copies, initialization workspace, and extra cache. Rehearse the memory peak and rollback before automating a scheduled update. The label maturity and quality gates below decide whether that resource-consuming promotion should happen at all.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-three-kinds-of-change&quot;&gt;Distinguish three kinds of change&lt;/h2&gt;

&lt;p&gt;Input drift means the distribution of observations has changed. Prediction drift means the outputs have changed. Quality degradation means predictions have become less useful against a defined outcome. These signals can coincide, but none is a universal substitute for the others.&lt;/p&gt;

&lt;p&gt;A new customer population can shift inputs while the model continues to work well. A unit conversion error can shift inputs and destroy performance without creating any need for new learning. A changed relationship between inputs and outcomes can harm quality even when individual feature histograms look familiar.&lt;/p&gt;

&lt;p&gt;Monitor source freshness, schema, missingness, and units before interpreting a statistical drift alert. Operational data defects should be repaired at the source or contained, rather than taught to the model as a new normal.&lt;/p&gt;

&lt;h2 id=&quot;define-triggers-and-investigation-paths&quot;&gt;Define triggers and investigation paths&lt;/h2&gt;

&lt;p&gt;A calendar trigger is useful when there is a known reason to refresh, such as a regular arrival of mature labels. An event trigger may respond to a sustained quality decline, a documented change in the task, or a substantial addition of relevant data. Keep the reason in the candidate manifest.&lt;/p&gt;

&lt;p&gt;Choose a reference window, observation window, minimum sample size, and persistence rule for each alert. One changed histogram from a tiny overnight sample should not start an expensive training run. Investigate whether the change is expected seasonality, a new source, or a measurement problem.&lt;/p&gt;

&lt;p&gt;A practical policy can separate “investigate,” “produce a challenger,” and “promote.” Retraining need not imply automatic deployment. Where the consequences are modest and the gates are strong, some steps may be automated; where evidence is weak, retain review.&lt;/p&gt;

&lt;h2 id=&quot;respect-the-label-delay&quot;&gt;Respect the label delay&lt;/h2&gt;

&lt;p&gt;Suppose an illustrative service predicts a thirty-day outcome. Today’s records cannot yet provide complete thirty-day labels. A nightly rebuild that treats those records as negative trains on an outcome that has not had time to occur.&lt;/p&gt;

&lt;p&gt;Define a label maturity cutoff. Record the cohort eligible for scoring, the cohort still awaiting outcomes, and the rate of later corrections. If some outcomes arrive sooner than others, evaluating only the available labels can bias the apparent result.&lt;/p&gt;

&lt;p&gt;Report recent service behavior separately from mature quality measurements. Operators still need immediate signals such as input failures and output distribution changes, but those are provisional diagnostics rather than demonstrated changes in accuracy.&lt;/p&gt;

&lt;h2 id=&quot;choose-the-training-window-deliberately&quot;&gt;Choose the training window deliberately&lt;/h2&gt;

&lt;p&gt;A recent-only window adapts quickly but can forget uncommon conditions and seasonal patterns. An expanding window retains history but may dilute a genuine change. A weighted window introduces another modeling choice that needs validation.&lt;/p&gt;

&lt;p&gt;Compare candidate window policies on historical cutoffs that resemble the intended update process. Reconstruct what would have been known at each cutoff, including label delays. Do not evaluate a monthly retraining design using a dataset assembled with future corrections and then assume the production version will reproduce the result.&lt;/p&gt;

&lt;p&gt;Preserve rare but important failure cases in an appropriate evaluation set. Repeating them indefinitely in training can erase their value as a test, so maintain the boundary between learning examples and release evidence.&lt;/p&gt;

&lt;h2 id=&quot;compare-the-challenger-against-a-frozen-champion&quot;&gt;Compare the challenger against a frozen champion&lt;/h2&gt;

&lt;p&gt;Evaluate both candidates on the same mature cases with the same decision policy. Also compare threshold-adjusted policies when that is the real operational choice, documenting how thresholds were selected.&lt;/p&gt;

&lt;p&gt;Require improvement where it matters and bounded regression elsewhere. A single aggregate can hide a damaged customer segment, larger review queue, or much worse tail latency. Prespecify critical slices and limits before looking at the challenger’s final scores.&lt;/p&gt;

&lt;p&gt;Keep the current model fixed during the comparison. If its runtime or preprocessing changes, it is a new baseline artifact and needs a new identity. “The old model” is not a reproducible comparator if its dependencies keep moving.&lt;/p&gt;

&lt;h2 id=&quot;control-the-feedback-loop&quot;&gt;Control the feedback loop&lt;/h2&gt;

&lt;p&gt;A deployed model changes which cases people investigate, which labels are collected, and sometimes the outcome itself. An alert can prevent a failure; a routing decision can determine which specialist sees a ticket. The observed data is partly a result of the policy.&lt;/p&gt;

&lt;p&gt;Record model version, decision, intervention, and eventual outcome together. A corrected machine that does not fail is not necessarily evidence that the original warning was false. Preserve a domain-appropriate way to estimate performance beyond the cases selected by the model, such as reviewed random samples where safe and appropriate.&lt;/p&gt;

&lt;p&gt;Do not feed generated answers or unreviewed pseudo-labels back into training without tracking their origin. They can magnify systematic mistakes while appearing to increase the dataset size.&lt;/p&gt;

&lt;h2 id=&quot;stage-promotion-and-make-rollback-compatible&quot;&gt;Stage promotion and make rollback compatible&lt;/h2&gt;

&lt;p&gt;Begin with offline tests. A shadow stage can compare outputs on live inputs without changing decisions, provided the additional processing is authorized and capacity is controlled. A limited rollout then measures actual service behavior and downstream effects.&lt;/p&gt;

&lt;p&gt;Define stop conditions, an observation period, and the person or automation responsible for acting. A canary receiving only easy cases cannot demonstrate safety on the difficult production mix. Confirm routing and compare the populations receiving each version.&lt;/p&gt;

&lt;p&gt;Rollback must include preprocessing, thresholds, schemas, and feature availability. An old checkpoint may no longer load against a changed feature contract. Retain a complete compatible bundle and rehearse how traffic returns to it.&lt;/p&gt;

&lt;h2 id=&quot;make-each-retraining-cycle-explainable&quot;&gt;Make each retraining cycle explainable&lt;/h2&gt;

&lt;p&gt;A cycle record should contain the trigger, source snapshots, label cutoff, window policy, training configuration, evaluation results, promotion decision, and any exceptions. Keep rejected candidates and their reasons long enough to explain repeated failures.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://research.google/pubs/hidden-technical-debt-in-machine-learning-systems/&quot;&gt;2015 hidden technical debt paper&lt;/a&gt; identifies feedback and dependency risks; the &lt;a href=&quot;https://arxiv.org/abs/2209.09125&quot;&gt;2022 operationalizing ML study&lt;/a&gt; describes production ML as continuing evaluation and maintenance. The controls here are proposed operating practices for those concerns.&lt;/p&gt;

&lt;p&gt;If several retraining cycles fail the same acceptance tests, investigate the data and the trigger policy before scheduling more compute. Another completed run will not resolve an unanswered quality question.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>PowerScale multiprotocol access: prove who the same user becomes</title>
    <link href="https://www.wirewalk.com/writing/powerscale-multiprotocol-identity-acls/"/>
    <published>2024-11-27T00:00:00-05:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/powerscale-multiprotocol-identity-acls/</id>
    <summary>An SMB login and an NFS identity can reach the same files through different mappings. Test both paths.</summary>
    <content type="html">&lt;p&gt;The same file can be properly restricted from Windows and unexpectedly accessible from Linux. Its contents have not changed; the server is interpreting a different identity and authorization path. Test both paths on a PowerScale system that serves SMB and NFS.&lt;/p&gt;

&lt;h2 id=&quot;map-identity-before-editing-permissions&quot;&gt;Map identity before editing permissions&lt;/h2&gt;

&lt;p&gt;OneFS supports directory services, access zones, and identity mapping across protocol identities. Dell describes combining identities into an access token and configuring mappings within individual zones. See &lt;a href=&quot;https://www.dell.com/support/manuals/en-us/isilon-onefs/ifs-pub-9900-administration-guide-gui/identity-management-overview?guid=guid-b028d620-cb7c-432d-b03f-983aa36db9ca&amp;amp;lang=en-us&quot;&gt;identity management&lt;/a&gt; and &lt;a href=&quot;https://www.dell.com/support/manuals/en-us/isilon-onefs/ifs_pub_9700_administration_guide_gui/user-mapping?guid=guid-0498c400-ff06-4eb6-bd27-854c7b6e9021&amp;amp;lang=en-us&quot;&gt;user mapping&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For one affected file, record the client protocol, zone, authentication provider, user SID or UID, groups, and effective file permissions. Do not start with a recursive permission change. That destroys evidence and can widen access across a much larger tree.&lt;/p&gt;

&lt;h2 id=&quot;construct-a-small-access-matrix&quot;&gt;Construct a small access matrix&lt;/h2&gt;

&lt;p&gt;Use a test share and export containing synthetic data. Choose an owner, a same-team reader, and an unrelated user. Exercise each from both client types.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Operation&lt;/th&gt;
      &lt;th&gt;Owner&lt;/th&gt;
      &lt;th&gt;Reader&lt;/th&gt;
      &lt;th&gt;Unrelated user&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Read existing file&lt;/td&gt;
      &lt;td&gt;Allow&lt;/td&gt;
      &lt;td&gt;Allow&lt;/td&gt;
      &lt;td&gt;Deny&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Create new file&lt;/td&gt;
      &lt;td&gt;Allow&lt;/td&gt;
      &lt;td&gt;Deny&lt;/td&gt;
      &lt;td&gt;Deny&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Rename or delete&lt;/td&gt;
      &lt;td&gt;Allow&lt;/td&gt;
      &lt;td&gt;Deny&lt;/td&gt;
      &lt;td&gt;Deny&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Change permissions&lt;/td&gt;
      &lt;td&gt;Explicit policy&lt;/td&gt;
      &lt;td&gt;Deny&lt;/td&gt;
      &lt;td&gt;Deny&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;This is an example policy, not a default OneFS behavior. Adapt it to the application. Test the directory as well as the file, because creation, rename, and deletion involve directory authorization.&lt;/p&gt;

&lt;h2 id=&quot;inspect-the-client-view&quot;&gt;Inspect the client view&lt;/h2&gt;

&lt;p&gt;On a Linux client with the relevant utilities installed, these are read-only starting points:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;id
&lt;/span&gt;findmnt &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; nfs,nfs4
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ln&lt;/span&gt; /mnt/security-lab
getfacl /mnt/security-lab/example.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;getfacl&lt;/code&gt; is a client-side view; it does not necessarily expose every server-side Windows ACL semantic. Pair it with OneFS effective-identity and ACL inspection for the installed release. On Windows, inspect the actual connected identity and both share and file permissions.&lt;/p&gt;

&lt;p&gt;Repeat the access test after a group membership change using a new authenticated session. An existing session or cached token can preserve old access and make the timing look inconsistent.&lt;/p&gt;

&lt;h2 id=&quot;what-a-migration-must-preserve&quot;&gt;What a migration must preserve&lt;/h2&gt;

&lt;p&gt;Before moving a directory tree, capture ownership, inherited ACL behavior, identity mappings, and application service identities. A byte-identical copy can still be an authorization failure if SID-to-UID mapping changes at the destination.&lt;/p&gt;

&lt;p&gt;Accept the migration only when the expected allowed and denied operations agree on both protocols. Keep the test users and synthetic dataset for later directory or OneFS upgrades. The same tests can catch a mapping change during the next upgrade, when an old permissions screenshot would tell you very little.&lt;/p&gt;

&lt;p&gt;Related: &lt;a href=&quot;/writing/nfs-auth-sys-kerberos-boundaries/&quot;&gt;NFS authentication boundaries&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>PowerScale SmartLock: a successful replica can have the wrong protection</title>
    <link href="https://www.wirewalk.com/writing/powerscale-smartlock-replication-retention/"/>
    <published>2024-11-03T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/powerscale-smartlock-replication-retention/</id>
    <summary>Check destination WORM state and retention explicitly instead of treating a successful replication job as proof.</summary>
    <content type="html">&lt;p&gt;On PowerScale and older Isilon systems, SnapshotIQ, SyncIQ and SmartLock protect against different problems. A dashboard that rolls them into one green indicator can hide a serious gap: the remote data arrived, but its intended retention protection did not.&lt;/p&gt;

&lt;p&gt;Check the destination independently. The presence of a replica does not tell you who can alter it or when it may be deleted.&lt;/p&gt;

&lt;h2 id=&quot;read-the-source-to-target-rules&quot;&gt;Read the source-to-target rules&lt;/h2&gt;

&lt;p&gt;Dell’s OneFS 9.9 backup guide documents that replicating a SmartLock enterprise directory before creating the target SmartLock directory can produce a normal target directory and a successful job. It also states that directory configuration is not carried across merely because WORM file state is replicated. See &lt;a href=&quot;https://www.dell.com/support/manuals/en-us/isilon-onefs/ifs_pub_backup_and_recovery_guide_9.9.0.0/smartlock-replication-limitations?guid=guid-250c03c8-56b7-41c9-b418-7ec149ed2cbc&quot;&gt;SmartLock replication limitations&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Those are release-specific rules, not permission to improvise on an existing compliance cluster. Consult the installed release’s guide before designing or changing the topology.&lt;/p&gt;

&lt;h2 id=&quot;separate-four-acceptance-questions&quot;&gt;Separate four acceptance questions&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Question&lt;/th&gt;
      &lt;th&gt;Evidence&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Did data arrive?&lt;/td&gt;
      &lt;td&gt;Destination file contents and replication completion&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Is the destination a SmartLock domain?&lt;/td&gt;
      &lt;td&gt;Destination domain configuration&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Is this file committed with the expected retention?&lt;/td&gt;
      &lt;td&gt;File state and expiration&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Can the service recover there?&lt;/td&gt;
      &lt;td&gt;Controlled recovery and client access test&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A checksum answers only the first row. A successful SyncIQ run does not replace the remaining rows.&lt;/p&gt;

&lt;h2 id=&quot;build-a-representative-test&quot;&gt;Build a representative test&lt;/h2&gt;

&lt;p&gt;Use an isolated source directory and a separate target path. Include a committed test file, an uncommitted file, and the directory settings the application depends on. Keep the retention window short enough for the approved lab exercise; retention changes can be irreversible within that window.&lt;/p&gt;

&lt;p&gt;Record the source and target domain types before replication. Run the supported policy, inspect the destination independently, and confirm that a client with ordinary write access cannot alter the committed test file. Verify the expected expiration rather than assuming every file inherited the same policy.&lt;/p&gt;

&lt;p&gt;Then evaluate failback using Dell’s matrix for the exact domain pair. A recovery plan that describes only copying forward leaves the harder operational decision unresolved.&lt;/p&gt;

&lt;h2 id=&quot;treat-time-and-workflow-as-dependencies&quot;&gt;Treat time and workflow as dependencies&lt;/h2&gt;

&lt;p&gt;Dell documents additional planning for compliance-mode failover, including cluster configuration and compliance clocks. &lt;a href=&quot;https://www.dell.com/support/manuals/en-us/isilon-onefs/ifs_pub_backup_and_recovery_guide_dell_emc/smartlock-compliance-mode-failover-and-failback?guid=guid-5f55892f-92b6-4219-bf55-4d79cfae4499&amp;amp;lang=en-us&quot;&gt;Its failover guide&lt;/a&gt; should be part of the change record.&lt;/p&gt;

&lt;p&gt;Keep retention requirements separate from product feature names. Choosing a mode does not establish the organization’s regulatory compliance. Document the source and destination protections, prove the recovery procedure and name the people responsible for exceptions.&lt;/p&gt;

&lt;p&gt;For the wider recovery sequence, read &lt;a href=&quot;/writing/replication-failback-clean-recovery/&quot;&gt;replication and clean failback&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Building a reproducible NVIDIA training platform: containers, storage, and recovery</title>
    <link href="https://www.wirewalk.com/writing/reproducible-model-training-release-pipeline/"/>
    <published>2024-10-23T10:00:00-04:00</published>
    <updated>2024-10-23T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/reproducible-model-training-release-pipeline/</id>
    <summary>An infrastructure-led training pipeline covering NGC containers, host-driver compatibility, GPU allocation, checkpoint bandwidth, reproducible runs, and complete inference release bundles.</summary>
    <content type="html">&lt;p&gt;When a training run fails, the team needs more than a checkpoint filename. They need the right dataset, compatible GPU software, enough storage to reload the state and a record of how the job was launched. Losing any of those can turn a routine restart into days of reconstruction.&lt;/p&gt;

&lt;p&gt;On an NVIDIA cluster, keep the host driver, CUDA libraries, container, framework, topology, dataset and scheduler settings together in the platform release record. Researchers can then compare experiments on a known environment and recover them without rebuilding it from memory.&lt;/p&gt;

&lt;h2 id=&quot;pin-the-host-to-container-compatibility-boundary&quot;&gt;Pin the host-to-container compatibility boundary&lt;/h2&gt;

&lt;p&gt;An NGC framework container packages important user-space dependencies; it does not replace the host’s NVIDIA driver or make every host kernel and device configuration compatible. Resolve the image tag to a digest and record the host driver, GPU inventory, container runtime integration, and any injected communication libraries.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-04.html&quot;&gt;PyTorch 24.04 release notes&lt;/a&gt; identify CUDA 12.4.1 and the release’s component and driver requirements. Use that as a historical example of a versioned compatibility record. Do not generalize its driver exceptions to an unrelated container release.&lt;/p&gt;

&lt;p&gt;Before admitting a platform image, load the framework, allocate a device tensor, execute a small representative kernel path, and run a short distributed job if the platform promises multiple nodes. Confirm device visibility and rank placement from inside the job. A successful image pull only proves the registry path worked.&lt;/p&gt;

&lt;h2 id=&quot;reserve-storage-and-network-capacity-for-checkpoint-bursts&quot;&gt;Reserve storage and network capacity for checkpoint bursts&lt;/h2&gt;

&lt;p&gt;Checkpoint traffic is bursty and often synchronized across ranks. Budget the complete model and optimizer state, retained generations, write amplification, and staging space. Use measured effective throughput under competing jobs to estimate pause duration; the array’s headline bandwidth is not the application’s guaranteed share.&lt;/p&gt;

&lt;p&gt;A hypothetical 200 GB completed checkpoint written in 40 seconds requires 5 GB/s of effective output over that interval, before allowing for concurrent writers or publication overhead. If several jobs checkpoint together, the service needs sufficient bandwidth, scheduling, or staggering to keep those pauses acceptable. Label the assumed sizes rather than presenting them as a measured model property.&lt;/p&gt;

&lt;p&gt;Keep checkpoint staging on fast storage only if the durability policy explains how it reaches recoverable shared storage. A completed local write is not protection from loss of the node. Measure restart reads and initialization as well as writes: recovery time includes reacquiring GPUs, loading state, reconstructing input position, and returning to useful work.&lt;/p&gt;

&lt;p&gt;The run contract below should link to the platform image and checkpoint policy. That makes an experiment portable between qualified allocations without pretending every machine with the same GPU name is identical.&lt;/p&gt;

&lt;h2 id=&quot;define-the-run-contract&quot;&gt;Define the run contract&lt;/h2&gt;

&lt;p&gt;Start with an immutable run configuration. It should name the task, dataset version, source model revision if applicable, transformation code, split policy, hyperparameters, stopping rules, precision mode, and random seeds. Resolve symbolic references such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;latest&lt;/code&gt; before the run starts and write the resolved identifiers into its manifest.&lt;/p&gt;

&lt;p&gt;Separate scientific settings from environment settings. Learning rate and label mapping define the experiment. Worker count, device topology, library builds, and compiler settings describe how it ran. Both affect reproducibility, but recording them separately makes comparisons easier to interpret.&lt;/p&gt;

&lt;p&gt;Assign a unique run identifier before work begins. Use it in logs, checkpoints, evaluation output, and artifact storage. A directory called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;final-final-2&lt;/code&gt; cannot serve as lineage when several people are experimenting simultaneously.&lt;/p&gt;

&lt;h2 id=&quot;validate-the-data-before-consuming-the-compute-budget&quot;&gt;Validate the data before consuming the compute budget&lt;/h2&gt;

&lt;p&gt;Run inexpensive checks on schema, row counts, null rates, label distribution, duplicate decision keys, and split overlap. Compare against the dataset contract, not merely the previous run: an earlier dataset may have been wrong too.&lt;/p&gt;

&lt;p&gt;Inspect a small decoded sample from the actual training loader. This catches mistakes that a valid source file does not expose, such as swapped labels, incorrect image channels, token truncation, or a preprocessing branch applied twice. Confirm that validation data travels through the intended evaluation transform rather than a training augmentation path.&lt;/p&gt;

&lt;p&gt;Make failures actionable. “Bad data” is less useful than “feature temperature changed from degrees Celsius to an unrecognized unit in source partition X.” Keep sensitive samples out of general logs; record enough identifiers for an authorized investigation.&lt;/p&gt;

&lt;h2 id=&quot;prove-the-smallest-run-first&quot;&gt;Prove the smallest run first&lt;/h2&gt;

&lt;p&gt;Before distributing work, overfit a tiny, controlled sample when appropriate for the task. Failure to fit even that sample can reveal a broken loss, frozen parameters, incorrect target encoding, or an optimizer that never updates the intended weights.&lt;/p&gt;

&lt;p&gt;Then run a short representative training segment and a complete evaluation pass. Confirm that reported losses are finite, gradients reach expected parameters, metrics use the correct labels, and checkpoint saving actually works. The purpose is pipeline validation, not a claim about final quality.&lt;/p&gt;

&lt;p&gt;Measure steady-state throughput and peak memory after startup effects. Estimate the full run cost with a margin for evaluation, checkpointing, failures, and queue time. A throughput measurement from cached toy inputs is not a budget for the production dataset.&lt;/p&gt;

&lt;h2 id=&quot;keep-experiment-comparisons-interpretable&quot;&gt;Keep experiment comparisons interpretable&lt;/h2&gt;

&lt;p&gt;Change a small number of independent choices at a time, unless a planned search strategy is explicitly exploring interactions. Preserve the baseline configuration. Record failed and interrupted runs instead of deleting every inconvenient result.&lt;/p&gt;

&lt;p&gt;Compare candidates at a meaningful budget: examples processed, tokens processed, wall time, or compute cost, depending on the question. Equal epochs are not equal budgets if filtering or sequence packing changes how much useful data is consumed.&lt;/p&gt;

&lt;p&gt;Early stopping and hyperparameter search are part of selection. They need a development set and a fixed policy. Do not let the final test set quietly become the signal used to decide when training should stop.&lt;/p&gt;

&lt;h2 id=&quot;checkpoint-the-state-needed-to-continue&quot;&gt;Checkpoint the state needed to continue&lt;/h2&gt;

&lt;p&gt;For a resumable training run, weights alone are often insufficient. Depending on the framework, continuation may require optimizer state, learning-rate scheduler state, gradient scaling state, random-number generator states, progress counters, and sampler position. Distributed sharding can add topology and format dependencies.&lt;/p&gt;

&lt;p&gt;Write checkpoints through a completion protocol. For example, write objects to a unique checkpoint location, verify expected components and checksums, then publish a small manifest declaring the checkpoint complete. Readers should not interpret a directory’s existence as proof that every worker finished writing.&lt;/p&gt;

&lt;p&gt;Test recovery by interrupting a nonproduction run and resuming it from a completed checkpoint. Check that the learning-rate schedule continues from the expected position and that data is neither silently skipped nor repeated contrary to the defined policy. Exact bitwise equivalence may be impractical on some hardware; specify whether the requirement is identical state restoration or statistically comparable final quality.&lt;/p&gt;

&lt;h2 id=&quot;evaluate-an-immutable-candidate&quot;&gt;Evaluate an immutable candidate&lt;/h2&gt;

&lt;p&gt;When training finishes, create an immutable candidate artifact and evaluate that artifact. Do not score one in-memory object and publish a differently exported file. Conversion, quantization, compilation, or adapter merging can change the deployed behavior and require their own validation.&lt;/p&gt;

&lt;p&gt;Capture aggregate metrics, critical slices, failed inputs, and latency measurements. Keep the complete output or a controlled sample sufficient for error analysis, subject to data handling requirements. Compare against the current production version using the same frozen evaluation inputs.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://research.google/pubs/the-ml-test-score-a-rubric-for-ml-production-readiness-and-technical-debt-reduction/&quot;&gt;2017 ML Test Score&lt;/a&gt; organizes production concerns around data, models, infrastructure, and monitoring. The release sequence here is an engineering proposal, rather than a claim that one metric proves readiness across all of those areas.&lt;/p&gt;

&lt;h2 id=&quot;package-the-inference-contract&quot;&gt;Package the inference contract&lt;/h2&gt;

&lt;p&gt;A release bundle should include more than parameters:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Component&lt;/th&gt;
      &lt;th&gt;Why it belongs in the release&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Model and preprocessing artifacts&lt;/td&gt;
      &lt;td&gt;Predictions depend on both&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Input and output schema&lt;/td&gt;
      &lt;td&gt;Callers need a stable contract&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Runtime and dependency identifiers&lt;/td&gt;
      &lt;td&gt;Loading behavior depends on the environment&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Evaluation and lineage manifests&lt;/td&gt;
      &lt;td&gt;Operators need to know what was approved&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Resource and health requirements&lt;/td&gt;
      &lt;td&gt;The scheduler must place a usable service&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Previous compatible release reference&lt;/td&gt;
      &lt;td&gt;Recovery needs a known destination&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Load the bundle in a clean serving environment and run acceptance cases through the external interface. Verify that missing fields, unsupported shapes, and oversized inputs produce the intended response.&lt;/p&gt;

&lt;h2 id=&quot;separate-experiment-freedom-from-release-authority&quot;&gt;Separate experiment freedom from release authority&lt;/h2&gt;

&lt;p&gt;Researchers need room to experiment. Production promotion needs a bounded, reviewable record of exactly what changes. A model registry can help organize that record, but a registry status is not a substitute for the evidence behind it.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://arxiv.org/abs/2209.09125&quot;&gt;2022 operationalizing ML study&lt;/a&gt; reports the importance of validation and versioning in production work. A practical application is to let many runs exist while requiring a complete bundle, explicit acceptance results, an owner, and a recovery path for the small number promoted to service.&lt;/p&gt;

&lt;p&gt;Before promoting the release, ask someone who did not build it to identify the inputs, repeat the evaluation and recover a failed run. Any files or instructions they have to ask for belong in the release bundle.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>VAST indestructible snapshots: test the authority to undo protection</title>
    <link href="https://www.wirewalk.com/writing/vast-indestructible-snapshots-security-boundary/"/>
    <published>2024-10-10T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/vast-indestructible-snapshots-security-boundary/</id>
    <summary>Retention, administrative separation, support unlock, and recovery are different parts of the same protection design.</summary>
    <content type="html">&lt;p&gt;A read-only snapshot protects its contents from client writes. Whether an administrator can delete the snapshot is a separate question. On VAST, examine the protection on the snapshots and policies, then identify every person or process allowed to change it.&lt;/p&gt;

&lt;h2 id=&quot;establish-the-documented-boundary&quot;&gt;Establish the documented boundary&lt;/h2&gt;

&lt;p&gt;VAST documents an Indestructibility feature that protects flagged snapshots and protection policies against deletion and retention reduction. Its architecture documentation also describes a controlled, time-limited support unlock. That exception belongs in the security model: the customer representatives and verification procedure behind it matter as much as the checkbox. See &lt;a href=&quot;https://kb.vastdata.com/documentation/docs/en/indestructibility-overview&quot;&gt;VAST’s overview&lt;/a&gt; and &lt;a href=&quot;https://www.vastdata.com/whitepaper&quot;&gt;the platform white paper&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Confirm the documentation for the installed VAST software release. Do not infer that a feature name proves protection against every administrator, every support workflow, or the loss of the entire site.&lt;/p&gt;

&lt;h2 id=&quot;write-a-protection-inventory&quot;&gt;Write a protection inventory&lt;/h2&gt;

&lt;p&gt;For every protected path, record its policy, snapshot frequency, retention, replication destination, and responsible team. Record whether protection was explicitly enabled and whether the most recent recovery point completed. A configured schedule and an existing snapshot are separate facts.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Review item&lt;/th&gt;
      &lt;th&gt;Evidence to collect&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Scope&lt;/td&gt;
      &lt;td&gt;Protected path and a file known to reside beneath it&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;History&lt;/td&gt;
      &lt;td&gt;Actual recovery-point timestamps&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Retention&lt;/td&gt;
      &lt;td&gt;Expiration shown for a specific protected snapshot&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Authority&lt;/td&gt;
      &lt;td&gt;Roles allowed to change policies or request unlock&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Off-site survival&lt;/td&gt;
      &lt;td&gt;Recovery point visible at the intended peer&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Export the inventory to an access-controlled evidence location. A screenshot without a snapshot identifier is difficult to reconcile later.&lt;/p&gt;

&lt;h2 id=&quot;exercise-a-disposable-policy&quot;&gt;Exercise a disposable policy&lt;/h2&gt;

&lt;p&gt;Create a small test dataset through the normal client protocol. Take a protected recovery point with an approved test retention. Modify the live test data and verify that the earlier version remains readable through the supported recovery workflow.&lt;/p&gt;

&lt;p&gt;Use an ordinary administrative role to attempt a forbidden policy or retention change on this test scope. Record the denial and the identity used. Then inspect the configuration again: an error message is less persuasive than a confirmed unchanged protection state.&lt;/p&gt;

&lt;p&gt;Separately review the support-unlock contacts and approval process with the customer owner. Do not initiate an unlock merely to prove the support channel exists. A tabletop review can establish who is authorized and how a compromised mailbox would be handled.&lt;/p&gt;

&lt;h2 id=&quot;plan-for-capacity-and-recovery&quot;&gt;Plan for capacity and recovery&lt;/h2&gt;

&lt;p&gt;Retained history occupies capacity as the live dataset changes. Model a high-change incident window as well as routine daily churn. An unexpectedly long retention period can create an operational problem precisely because ordinary deletion is restricted.&lt;/p&gt;

&lt;p&gt;Restore to an isolated destination and check representative files, permissions and application behavior. A retained snapshot still has to support a usable recovery. Keep both in the acceptance report, alongside &lt;a href=&quot;/writing/recovery-after-admin-compromise/&quot;&gt;the identity boundary around recovery&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Recovery after an administrator account is compromised</title>
    <link href="https://www.wirewalk.com/writing/recovery-after-admin-compromise/"/>
    <published>2024-09-16T00:00:00-04:00</published>
    <updated>2026-09-09T00:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/recovery-after-admin-compromise/</id>
    <summary>A recovery copy is only useful if the people and systems needed to restore it survive the same incident.</summary>
    <content type="html">&lt;p&gt;A successful backup offers little comfort if one stolen administrator account can remove every recovery point. Check what that account can actually do: disable protection, shorten retention, delete copies or retrieve the credentials for another backup system.&lt;/p&gt;

&lt;p&gt;The exercise below uses one critical service and disposable test data. It is a proposed recovery review, not a customer incident report. Trace everything needed to bring that service back, including identities and keys.&lt;/p&gt;

&lt;h2 id=&quot;draw-the-recovery-dependency-chain&quot;&gt;Draw the recovery dependency chain&lt;/h2&gt;

&lt;p&gt;An example service needs directory authentication, DNS, a virtualization platform, a storage share, database keys, and an application configuration repository. If the backup console authenticates only against the compromised directory, restoring the data does not solve the access problem. If the key server runs only on the failed storage, the recovery order is circular.&lt;/p&gt;

&lt;p&gt;Make a worksheet with a row for each dependency:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Dependency&lt;/th&gt;
      &lt;th&gt;Normal authority&lt;/th&gt;
      &lt;th&gt;Recovery authority&lt;/th&gt;
      &lt;th&gt;Independent copy&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Backup catalog&lt;/td&gt;
      &lt;td&gt;Backup service account&lt;/td&gt;
      &lt;td&gt;Recovery operator&lt;/td&gt;
      &lt;td&gt;Export outside production&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Encryption keys&lt;/td&gt;
      &lt;td&gt;KMS administrators&lt;/td&gt;
      &lt;td&gt;Documented recovery custodians&lt;/td&gt;
      &lt;td&gt;Supported KMS recovery material&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Storage configuration&lt;/td&gt;
      &lt;td&gt;Storage administrators&lt;/td&gt;
      &lt;td&gt;Restricted emergency account&lt;/td&gt;
      &lt;td&gt;Protected configuration export&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Application secrets&lt;/td&gt;
      &lt;td&gt;Application identity&lt;/td&gt;
      &lt;td&gt;Approved recovery workflow&lt;/td&gt;
      &lt;td&gt;Recoverable secret store&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The entries above are a design example. Replace them with named owners and tested procedures. Do not put credentials in the worksheet.&lt;/p&gt;

&lt;h2 id=&quot;test-the-administrator-boundary&quot;&gt;Test the administrator boundary&lt;/h2&gt;

&lt;p&gt;Use a disposable dataset under a short, approved protection policy. Enumerate what the ordinary storage administrator, backup administrator, and recovery operator can each do. Test permission denial against that dataset rather than attempting destructive operations against production backups.&lt;/p&gt;

&lt;p&gt;A useful negative test asks whether an everyday administrator can shorten retention or remove the final recovery point. A useful positive test asks whether the designated recovery operator can restore the protected copy without the normal production login path. Both are needed: a system that denies everyone is resistant to deletion but may also be impossible to recover.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.cisa.gov/stopransomware/ransomware-guide&quot;&gt;CISA’s ransomware guidance&lt;/a&gt; recommends protected backups and recovery testing. The dependency worksheet and role tests here are an engineering method for turning that objective into observable evidence.&lt;/p&gt;

&lt;h2 id=&quot;measure-service-recovery&quot;&gt;Measure service recovery&lt;/h2&gt;

&lt;p&gt;Record the start time, chosen recovery point, data restoration completion, application checks, and business acceptance. A mounted filesystem is an intermediate milestone. The application owner should read representative records, perform a controlled write, and confirm access boundaries.&lt;/p&gt;

&lt;p&gt;Keep the recovered service isolated until the incident team accepts the source data and credentials. Restoring an old image can restore persistence or a vulnerable configuration along with the application.&lt;/p&gt;

&lt;h2 id=&quot;what-to-retain&quot;&gt;What to retain&lt;/h2&gt;

&lt;p&gt;Keep the dependency map, permission-test results, recovery-point identifier, elapsed time, and remaining manual steps. Repeat the exercise when identity, encryption, backup tooling, or storage topology changes. Those changes can invalidate recovery without causing a single backup job to fail.&lt;/p&gt;

&lt;p&gt;Continue with &lt;a href=&quot;/writing/replication-failback-clean-recovery/&quot;&gt;replication and failback&lt;/a&gt; and &lt;a href=&quot;/writing/restore-benchmark-business-recovery/&quot;&gt;a restore benchmark&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Qualifying NVIDIA inference infrastructure: accuracy, latency, and capacity gates</title>
    <link href="https://www.wirewalk.com/writing/ai-evaluation-thresholds-calibration/"/>
    <published>2024-08-21T10:00:00-04:00</published>
    <updated>2024-08-21T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/ai-evaluation-thresholds-calibration/</id>
    <summary>Build an inference acceptance test that joins model quality with NVIDIA GPU memory, Triton request timing, batch behavior, concurrency, precision changes, and replica-loss capacity.</summary>
    <content type="html">&lt;p&gt;Offline accuracy tells you little about how long a researcher will wait for an answer when the inference server is busy. A high requests-per-second figure can be equally misleading if the answers fail the task. Test quality and latency together, on the NVIDIA system and at the concurrency you intend to support.&lt;/p&gt;

&lt;p&gt;Keep the deployment configuration with the model under evaluation. Batch policy, precision, instance count, input limits and fallback behavior can all change the result. Approve that combination as a release, so the production service matches what was tested.&lt;/p&gt;

&lt;h2 id=&quot;define-a-server-acceptance-matrix&quot;&gt;Define a server acceptance matrix&lt;/h2&gt;

&lt;p&gt;Test short, typical, and long inputs at several concurrency levels. Include cold loading separately from warm operation. For each cell, capture completed requests, rejected or timed-out requests, output validity, quality on the relevant cases, device memory, and latency percentiles. For generated text, separate first-token latency from completion time.&lt;/p&gt;

&lt;p&gt;Use a representative arrival process. A closed-loop client that waits for every reply can conceal queue growth under an external burst. Include a bounded burst or arrival-rate test that reflects the callers, and state which load model produced each result.&lt;/p&gt;

&lt;p&gt;Qualify the degraded condition too. If a service must survive one failed replica, test the remaining capacity and admission policy. Two servers operating near their maximum throughput do not automatically supply one-server redundancy.&lt;/p&gt;

&lt;h2 id=&quot;attribute-triton-latency-before-changing-hardware&quot;&gt;Attribute Triton latency before changing hardware&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://raw.githubusercontent.com/triton-inference-server/server/r24.04/docs/user_guide/metrics.md&quot;&gt;Triton 24.04 metrics reference&lt;/a&gt; distinguishes request, inference, and execution counts and exposes timing components. Use those counters with client-side timings to separate queueing, input handling, computation, and response work. Do not label a server-side compute average as user-visible tail latency.&lt;/p&gt;

&lt;p&gt;For a stateless model compatible with Triton’s dynamic batching, measure the throughput benefit against added queue delay. Also measure the memory impact of additional model instances. A larger batch or another instance can improve one test point while making long requests miss their deadline.&lt;/p&gt;

&lt;p&gt;If a candidate changes numerical precision or uses a TensorRT export, rerun the held-out quality and slice checks on that exact artifact. A smaller engine or faster kernel does not excuse a damaged critical output category. Preserve the framework baseline and input/output comparison so that a numerical regression can be distinguished from a load-generator or preprocessing error.&lt;/p&gt;

&lt;p&gt;The acceptance report should name the GPU SKU and memory, server topology, driver, CUDA runtime, serving backend, artifact revision, batch policy, and offered load. These are the conditions under which the quality and capacity evidence is valid.&lt;/p&gt;

&lt;h2 id=&quot;specify-the-decision-policy&quot;&gt;Specify the decision policy&lt;/h2&gt;

&lt;p&gt;For a binary classifier, define the positive class and the action triggered by a positive prediction. State what happens below the threshold, what happens in an uncertainty band, and whether an operator can override the system.&lt;/p&gt;

&lt;p&gt;For an illustrative alerting service, a high score might create an urgent page, a middle score might create a review task, and a low score might produce no action. Each path has a capacity limit and a different error cost. Evaluate all three paths rather than converting everything to one binary accuracy number.&lt;/p&gt;

&lt;p&gt;Include failure to produce a prediction. Invalid input, timeouts, rejected requests, and unavailable features need explicit denominators. Removing these records before scoring can make an unreliable service appear excellent.&lt;/p&gt;

&lt;h2 id=&quot;use-prevalence-to-interpret-precision&quot;&gt;Use prevalence to interpret precision&lt;/h2&gt;

&lt;p&gt;Imagine 100,000 decision opportunities containing 100 real positives. At 90% sensitivity, the system finds 90 positives. If its false-positive rate is 1%, it also flags 999 of the 99,900 negatives. Precision is then 90 divided by 1,089, approximately 8.3%.&lt;/p&gt;

&lt;p&gt;These are illustrative arithmetic values, not measured product results. They show why a seemingly small false-positive rate can overwhelm an operator when the target is rare. If the review team can handle only 200 cases, the policy is infeasible even though its sensitivity might look attractive in isolation.&lt;/p&gt;

&lt;p&gt;Keep a confusion matrix with counts, not just percentages. Also report the population and sampling procedure. A balanced development set can be useful for studying errors, but its apparent precision is not the expected precision in a population with a much rarer event.&lt;/p&gt;

&lt;h2 id=&quot;distinguish-ranking-from-calibration&quot;&gt;Distinguish ranking from calibration&lt;/h2&gt;

&lt;p&gt;A ranking metric evaluates ordering. A calibrated probability has a different promise: among comparable cases assigned a probability near 0.2, roughly one fifth should be positive over a suitable population and observation period.&lt;/p&gt;

&lt;p&gt;A model can rank well and be poorly calibrated. Examine reliability by score bands, sample counts, and important slices. Avoid drawing a calibration curve with tiny bins and treating the shape as stable evidence. If calibration is fitted, use development data that is separate from final testing and check the result again under the deployment distribution.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://scikit-learn.org/1.4/modules/calibration.html&quot;&gt;scikit-learn 1.4 probability calibration guide&lt;/a&gt; distinguishes probability reliability from discrimination and describes calibration methods. The engineering policy proposed here is to choose a calibration procedure and threshold on development evidence, then freeze both before the final comparison.&lt;/p&gt;

&lt;h2 id=&quot;evaluate-slices-that-can-change-the-decision&quot;&gt;Evaluate slices that can change the decision&lt;/h2&gt;

&lt;p&gt;Choose slices before examining candidate results where practical: input source, language, document length, missing-feature pattern, device family, and new versus established entities. Add slices discovered during error analysis, but distinguish exploratory findings from prespecified release criteria.&lt;/p&gt;

&lt;p&gt;Record counts and uncertainty for every slice. A 100% score on four examples does not establish reliability. If a slice is important and poorly sampled, collect more examples or constrain deployment until there is enough evidence.&lt;/p&gt;

&lt;p&gt;Keep intersections in view. A system may work on long documents and on scanned documents separately while failing on long scanned documents. Avoid generating thousands of tiny slices with no hypothesis; use the failure mechanism to guide investigation.&lt;/p&gt;

&lt;h2 id=&quot;make-human-judgments-reproducible&quot;&gt;Make human judgments reproducible&lt;/h2&gt;

&lt;p&gt;For generated answers, define a rubric with separate dimensions such as factual correctness, completeness, adherence to the requested format, and unsupported assertions. Specify which errors are release blockers. A fluent response should not earn credit for a fact it invented.&lt;/p&gt;

&lt;p&gt;Have reviewers score a shared calibration sample. Discuss disagreements and revise ambiguous instructions before evaluating finalists. Preserve the original judgments as well as adjudicated results, since disagreement is information about the task.&lt;/p&gt;

&lt;p&gt;Model-based judges can assist with triage, but their scores need validation against human review on the actual task. Avoid asking a candidate to be its own sole judge. Keep candidate names hidden when feasible and randomize presentation order in pairwise comparisons.&lt;/p&gt;

&lt;h2 id=&quot;preserve-the-unit-of-independence&quot;&gt;Preserve the unit of independence&lt;/h2&gt;

&lt;p&gt;If ten thousand rows come from fifty customers, uncertainty based on ten thousand independent observations may be misleading. Sample or resample at the customer level when that matches the dependency structure. Time-series evaluations need methods that respect temporal dependence rather than arbitrary row shuffling.&lt;/p&gt;

&lt;p&gt;Use paired comparisons when candidates are evaluated on the same cases. Inspect where one succeeds and the other fails. A small average advantage may be driven by one prolific source, while a particular critical error worsens.&lt;/p&gt;

&lt;p&gt;Report uncertainty in a form the release owner can use. If the interval is too wide to distinguish candidates under the acceptance rule, the conclusion is insufficient evidence, not a forced winner.&lt;/p&gt;

&lt;h2 id=&quot;lock-the-release-test-and-include-the-whole-service&quot;&gt;Lock the release test and include the whole service&lt;/h2&gt;

&lt;p&gt;Before final scoring, freeze model revision, feature or prompt code, preprocessing, decoding settings, threshold, and input contract. Test the validation layer and fallback path as part of the service. A model that usually produces correct JSON is not a reliable structured API unless invalid outputs are detected and handled.&lt;/p&gt;

&lt;p&gt;Measure quality under representative concurrency as well as offline conditions. If timeouts disproportionately remove the longest requests, offline quality no longer describes the deployed service. Count retries and human repairs in both cost and success rate.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://scikit-learn.org/1.4/modules/model_evaluation.html&quot;&gt;scikit-learn 1.4 model evaluation reference&lt;/a&gt; explains the definitions and limitations of common metrics. Definitions alone do not choose an acceptable threshold; the application owner must connect the metrics to consequences and capacity.&lt;/p&gt;

&lt;h2 id=&quot;write-a-decision-another-person-can-audit&quot;&gt;Write a decision another person can audit&lt;/h2&gt;

&lt;p&gt;A release report should contain the dataset version, sampling frame, label maturity, policy thresholds, aggregate counts, slice results, latency and failure rates, and a list of unresolved error modes. Include examples that demonstrate the most consequential failures.&lt;/p&gt;

&lt;p&gt;Choose monitoring signals that correspond to the evaluation assumptions. If the evaluation depended on a stable document source or a known feature availability rate, monitor those properties. Those signals tell you when the original test no longer describes the service people are using.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Feeding NVIDIA training GPUs: data staging, preprocessing, and correct datasets</title>
    <link href="https://www.wirewalk.com/writing/training-data-point-in-time-leakage/"/>
    <published>2024-07-17T10:00:00-04:00</published>
    <updated>2024-07-17T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/training-data-point-in-time-leakage/</id>
    <summary>Design a training input path that keeps NVIDIA GPUs supplied while preserving point-in-time correctness, dataset versions, host-memory limits, storage capacity, and recovery behavior.</summary>
    <content type="html">&lt;p&gt;The dataset fits on storage, yet the GPUs keep waiting. File opens, CPU decoding and repeated remote reads can account for much of that delay. Fixing the loader helps only if it also delivers the right records: a fast pipeline with future information leaking into historical examples will train a misleading model.&lt;/p&gt;

&lt;p&gt;Follow the data from ingestion through preprocessing and staging to device memory. At each step, check both the time spent and the dataset version being produced. Throughput and historical correctness need to survive the same pipeline.&lt;/p&gt;

&lt;h2 id=&quot;budget-the-path-from-source-storage-to-device-memory&quot;&gt;Budget the path from source storage to device memory&lt;/h2&gt;

&lt;p&gt;Measure source discovery, open latency, read throughput, decode time, host-to-device transfer, and time waiting for the next batch. Use the actual file-size distribution and augmentation policy. A sequential storage benchmark cannot stand in for a loader opening small compressed objects across many workers.&lt;/p&gt;

&lt;p&gt;Plan host RAM for loader processes, decoded batches, prefetch queues, and pinned transfer buffers. Multiply by concurrent jobs on the node. More loader workers can increase throughput until they saturate CPUs, memory bandwidth, the metadata service, or the source; beyond that point they can make every job slower.&lt;/p&gt;

&lt;p&gt;A proposed staging policy is to copy a versioned dataset shard to node-local NVMe, validate it against its manifest, and reuse it for the allocation’s lifetime. Record which copy is authoritative and what a node failure or reimage removes. Reserve scratch for both staged input and checkpoints rather than allowing one to exhaust the other.&lt;/p&gt;

&lt;h2 id=&quot;select-nvidia-data-path-tools-for-the-measured-bottleneck&quot;&gt;Select NVIDIA data-path tools for the measured bottleneck&lt;/h2&gt;

&lt;p&gt;NVIDIA DALI is a candidate for supported decoding and preprocessing operations. Its presence in the &lt;a href=&quot;https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-04.html&quot;&gt;NVIDIA PyTorch 24.04 container&lt;/a&gt; establishes an available historical software option. It does not establish that arbitrary Python feature engineering or tokenization automatically moves onto the GPU. Compare a representative loader with and without the proposed preprocessing path.&lt;/p&gt;

&lt;p&gt;GPUDirect Storage is a separate option for compatible storage-to-GPU transfers through a cuFile-aware application. The &lt;a href=&quot;https://docs.nvidia.com/cuda/archive/11.4.0/gds/overview-guide/index.html&quot;&gt;CUDA 11.4 GDS overview&lt;/a&gt; describes the direct path and compatibility behavior. Validate the filesystem, driver, device topology, and application integration before claiming the CPU staging path was bypassed. A normal filesystem mount alone does not provide that integration.&lt;/p&gt;

&lt;p&gt;For either option, compare useful samples or supervised tokens per second, CPU load, device idle gaps, and storage traffic. Preserve decoded sample checks and the temporal dataset rules below. Acceleration changes how inputs arrive; it does not establish that those inputs were valid at prediction time.&lt;/p&gt;

&lt;h2 id=&quot;define-prediction-time-before-writing-joins&quot;&gt;Define prediction time before writing joins&lt;/h2&gt;

&lt;p&gt;Consider an illustrative maintenance model that predicts whether a machine will fail in the next seven days. Each training row needs a machine identifier, a prediction timestamp, a feature history cutoff, and a label window. A repair code recorded three days after the prediction belongs to the outcome history. It cannot become an input merely because it is now present in the same database.&lt;/p&gt;

&lt;p&gt;Define whether the system makes one prediction per machine per day, per shift, or per observed event. That choice determines which records are eligible, how overlapping examples are handled, and how often an operator would receive an alert. A dataset of handpicked incidents answers a different question from a dataset of all actual decision opportunities.&lt;/p&gt;

&lt;p&gt;Write these definitions in the dataset contract. A field named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;date&lt;/code&gt; is inadequate when it could mean event occurrence, ingestion, correction, or warehouse refresh.&lt;/p&gt;

&lt;h2 id=&quot;preserve-event-time-and-knowledge-time&quot;&gt;Preserve event time and knowledge time&lt;/h2&gt;

&lt;p&gt;An event can occur before a prediction and still arrive too late to be usable. For each source, distinguish when the event happened from when the relevant system received it. Preserve correction history where possible.&lt;/p&gt;

&lt;p&gt;A historical feature should obey both constraints:&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;source.event_time &amp;lt;= prediction_time
source.available_at &amp;lt;= prediction_time
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For rolling features, also enforce the lower bound of the chosen lookback window. Use a documented inclusive or exclusive boundary so that an observation arriving at precisely the cutoff is handled consistently.&lt;/p&gt;

&lt;p&gt;The simple pair of predicates is a design sketch, not a complete temporal database implementation. If a source row can be corrected, select the latest version available at the cutoff rather than the latest version today. A correction that moves a payment or sensor reading backward in event time can otherwise contaminate an entire historical dataset.&lt;/p&gt;

&lt;h2 id=&quot;join-aggregates-at-the-correct-grain&quot;&gt;Join aggregates at the correct grain&lt;/h2&gt;

&lt;p&gt;A common leak appears in group-level features: average customer spend, neighborhood failure rate, or supplier reliability is calculated across the complete dataset and then joined onto earlier rows. The aggregate includes later outcomes, sometimes including the row’s own target.&lt;/p&gt;

&lt;p&gt;For each aggregate, record its entity keys, source interval, availability lag, and minimum sample requirement. Calculate it using the same historical restriction as the raw inputs. Decide what to return for an entity with no earlier history; a value fitted using future observations is not a legitimate missing-value fallback.&lt;/p&gt;

&lt;p&gt;Check join multiplicity before training. A one-to-many join can silently duplicate positive events and change the label distribution. Compare counts, unique decision keys, and null rates before and after every major join. Make intended multiplicity an assertion rather than a comment.&lt;/p&gt;

&lt;h2 id=&quot;split-by-the-dependency-that-matters&quot;&gt;Split by the dependency that matters&lt;/h2&gt;

&lt;p&gt;Random row splitting is appropriate only when the independence assumption fits the task. Repeated measurements of one person, machine, document family, or customer often make rows dependent. Put related records into the same fold when the goal is to generalize to new entities.&lt;/p&gt;

&lt;p&gt;For forecasting, preserve time order. Consider a gap between training and validation when label windows overlap or when adjacent observations expose nearly identical histories. For a seven-day outcome, training examples immediately before the cutoff may have outcomes extending into the validation period. Specify whether those examples are excluded or whether label availability is delayed.&lt;/p&gt;

&lt;p&gt;A time split and an entity split test different generalization questions. Evaluate both if deployment includes both future records from known machines and records from newly installed machines. Do not combine them into one score and lose the distinction.&lt;/p&gt;

&lt;h2 id=&quot;fit-preprocessing-within-the-training-boundary&quot;&gt;Fit preprocessing within the training boundary&lt;/h2&gt;

&lt;p&gt;Imputation values, scaling parameters, selected features, encodings, and dimensionality reduction can all leak information when fitted on the full dataset. Fit them on the training portion of each fold, then apply the fitted transform to validation data. The &lt;a href=&quot;https://scikit-learn.org/1.4/common_pitfalls.html&quot;&gt;scikit-learn 1.4 pitfalls guide&lt;/a&gt; documents preprocessing leakage and the use of pipelines to keep fitted operations inside the appropriate split.&lt;/p&gt;

&lt;p&gt;Target encodings require extra care because the transform itself uses labels. A training row’s encoded value should not simply reveal its own label through a small group average. Use an appropriate out-of-fold construction within the training set and preserve the distinction between training-time and serving-time lookup behavior.&lt;/p&gt;

&lt;p&gt;Inspect less obvious inputs too: filenames containing diagnosis codes, document templates introduced after an outcome, and identifiers assigned in chronological order. A high feature importance can be a clue to a broken dataset rather than an insight into the domain.&lt;/p&gt;

&lt;h2 id=&quot;treat-labels-as-versioned-data&quot;&gt;Treat labels as versioned data&lt;/h2&gt;

&lt;p&gt;A missing outcome is not always a negative outcome. A machine installed yesterday has not completed a seven-day observation window. A transaction under investigation may not have a final classification. Record maturity rules and keep censored examples out of a fully observed target unless the modeling method explicitly handles censoring.&lt;/p&gt;

&lt;p&gt;Track when labels become available and when they are revised. Rebuild evaluations when meaningful corrections arrive, while retaining the original dataset version so that an old result remains explainable. A changing label definition is a change to the task, even when the column name stays the same.&lt;/p&gt;

&lt;p&gt;For human annotation, preserve the instructions, adjudication policy, and sampling scheme. Reviewers can also see future information; their interface must match the annotation question you intended to ask.&lt;/p&gt;

&lt;h2 id=&quot;make-the-dataset-reconstructible&quot;&gt;Make the dataset reconstructible&lt;/h2&gt;

&lt;p&gt;A useful manifest records source snapshots or immutable object versions, query revision, time boundaries, entity split assignments, transformation code, label policy, row counts, and content checksums where practical. A random seed alone cannot reconstruct data that has since changed.&lt;/p&gt;

&lt;p&gt;Run a deliberately hostile review: remove the most predictive suspicious feature, move the cutoff earlier, evaluate on entirely new entities, and compare performance. A large collapse is not automatic proof of leakage, but it identifies an assumption worth investigating before deployment.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://research.google/pubs/hidden-technical-debt-in-machine-learning-systems/&quot;&gt;2015 paper on hidden technical debt in ML systems&lt;/a&gt; describes the risks of data dependencies and system interactions. The timestamp and join checks above address that problem directly: every feature used in a historical example must have been available when the real decision would have been made.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>AI model selection as infrastructure design: sizing NVIDIA GPU services</title>
    <link href="https://www.wirewalk.com/writing/ai-model-selection-operating-criteria/"/>
    <published>2024-06-12T10:00:00-04:00</published>
    <updated>2024-06-12T10:00:00-04:00</updated>
    <id>https://www.wirewalk.com/writing/ai-model-selection-operating-criteria/</id>
    <summary>How model requirements translate into NVIDIA GPU memory, server topology, TensorRT compatibility, Triton capacity, storage, power, and a defensible hardware acceptance test.</summary>
    <content type="html">&lt;p&gt;A model that wins a benchmark can still be a poor fit for the service you need to run. It may need more GPU memory than the available servers have, miss the latency target under load, or leave too little capacity for a failed replica. Model selection is also a decision about the infrastructure and people who will support it.&lt;/p&gt;

&lt;p&gt;Work through the workload and the NVIDIA platform together. A large model spread across tightly coupled GPUs creates different placement and recovery problems from a classifier that fits on one device. Include those costs while comparing quality, before the hardware is ordered.&lt;/p&gt;

&lt;h2 id=&quot;translate-the-model-shortlist-into-a-hardware-shortlist&quot;&gt;Translate the model shortlist into a hardware shortlist&lt;/h2&gt;

&lt;p&gt;Build a capacity sheet for each candidate: weight representation, runtime workspace, activations, concurrent requests, and, for autoregressive generation, the key/value cache. Include maximum admitted input and output lengths. Parameter count alone cannot establish how many requests fit.&lt;/p&gt;

&lt;p&gt;Compare actual server configurations rather than GPU family names. A100 and H100 are relevant data-center candidates, but memory capacity, form factor, power envelope, and GPU interconnect depend on the exact product and server design. A PCIe system and an SXM system are different infrastructure choices. Verify slot layout, power delivery, cooling, and the path from each GPU to its network adapter.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.nvidia.com/cuda/archive/12.4.1/ampere-tuning-guide/index.html&quot;&gt;CUDA 12.4.1 Ampere&lt;/a&gt; and &lt;a href=&quot;https://docs.nvidia.com/cuda/archive/12.4.1/hopper-tuning-guide/index.html&quot;&gt;Hopper tuning guides&lt;/a&gt; document architecture-specific behavior. Use them to identify compatibility and optimization questions, then measure the application. Architecture capability is not a guarantee that a particular framework invokes an efficient kernel.&lt;/p&gt;

&lt;h2 id=&quot;choose-the-nvidia-serving-path-before-procurement&quot;&gt;Choose the NVIDIA serving path before procurement&lt;/h2&gt;

&lt;p&gt;For supported workloads, evaluate TensorRT as an inference optimization path and Triton Inference Server as the service layer. TensorRT, Triton, and the language-specific runtime have different roles; installing one does not make an unsupported model graph deployable. Preserve a working framework baseline and validate exported or compiled candidates against it.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://raw.githubusercontent.com/triton-inference-server/server/r24.04/docs/user_guide/optimization.md&quot;&gt;Triton 24.04 optimization guide&lt;/a&gt; describes batching and instance-count tradeoffs. The proposed procurement test is an end-to-end load run with the intended batch policy, concurrency, input distribution, and tail-latency limit. Increase instance count only while memory and useful throughput remain acceptable.&lt;/p&gt;

&lt;p&gt;Include host CPU, RAM, NICs, storage, and a replica-loss scenario in that test. Record requests completed within the objective per server, not just a peak model-throughput figure. A smaller model with adequate quality may free a GPU for redundancy or another service; a more demanding model must justify the extra infrastructure with a measurable task benefit.&lt;/p&gt;

&lt;h2 id=&quot;write-the-task-as-an-input-and-an-accepted-output&quot;&gt;Write the task as an input and an accepted output&lt;/h2&gt;

&lt;p&gt;“Use AI for support” is too broad to evaluate. “Assign each incoming ticket to one of twelve queues, with uncertain cases sent to an operator” is a testable task. Record the input fields available at decision time, the output schema, the consumer of the output, and the action that follows it.&lt;/p&gt;

&lt;p&gt;Separate tasks that have different failure consequences. Drafting a proposed response and automatically changing an account are separate capabilities even if the same language model could produce both outputs. An extraction system may need exact field values and evidence spans; a search system may need useful ranking; a forecasting system needs errors measured at a specified horizon.&lt;/p&gt;

&lt;p&gt;Describe what the system should do when information is missing. An abstention is an output with an operating cost, not an embarrassing case to delete from the evaluation. A candidate that can identify uncertainty usefully may be preferable to one with slightly better average accuracy and uncontrolled confident errors.&lt;/p&gt;

&lt;h2 id=&quot;establish-a-simple-baseline&quot;&gt;Establish a simple baseline&lt;/h2&gt;

&lt;p&gt;Before comparing large models, build the least complicated credible solution. For structured classification this might be logistic regression or a boosted tree. For document routing it might be keywords plus an existing search index. For a bounded extraction task it might be a parser and a review queue.&lt;/p&gt;

&lt;p&gt;These are engineering controls on the experiment. If a more expensive candidate cannot beat the baseline under the real acceptance rules, additional model capacity has not justified its operating cost. The &lt;a href=&quot;https://arxiv.org/abs/1603.02754&quot;&gt;2016 XGBoost paper&lt;/a&gt; is useful historical context: scalable tree learning was already a serious option for structured data well before the current interest in generative systems. It does not establish that boosted trees win every tabular task.&lt;/p&gt;

&lt;p&gt;Compare against the current human or software process as well. Measure its error rate, turnaround time, and workload. Otherwise the project may optimize a model metric while making the actual service slower.&lt;/p&gt;

&lt;h2 id=&quot;apply-hard-gates-before-scoring-preferences&quot;&gt;Apply hard gates before scoring preferences&lt;/h2&gt;

&lt;p&gt;A weighted score can hide a disqualifying property. Treat mandatory requirements as pass/fail gates and document who can approve an exception.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Criterion&lt;/th&gt;
      &lt;th&gt;Evidence to request&lt;/th&gt;
      &lt;th&gt;Selection consequence&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Data handling&lt;/td&gt;
      &lt;td&gt;Actual hosting path, retention settings, operator access&lt;/td&gt;
      &lt;td&gt;Exclude incompatible processing arrangements&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Usage rights&lt;/td&gt;
      &lt;td&gt;License for the exact weights and intended use&lt;/td&gt;
      &lt;td&gt;Exclude unresolved restrictions&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Output behavior&lt;/td&gt;
      &lt;td&gt;Representative schema and failure tests&lt;/td&gt;
      &lt;td&gt;Require validation or reject the candidate&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Capacity&lt;/td&gt;
      &lt;td&gt;Measured latency at expected concurrency&lt;/td&gt;
      &lt;td&gt;Size the service or remove it from the shortlist&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Recovery&lt;/td&gt;
      &lt;td&gt;Available version, deployment artifact, rollback procedure&lt;/td&gt;
      &lt;td&gt;Reject an unmaintainable dependency&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A downloadable checkpoint is not automatically unrestricted software. Model weights, tokenizer files, training data, and serving components can carry different terms. Record the actual artifacts reviewed rather than relying on the label “open.”&lt;/p&gt;

&lt;h2 id=&quot;build-an-evaluation-set-that-resembles-deployment&quot;&gt;Build an evaluation set that resembles deployment&lt;/h2&gt;

&lt;p&gt;Sample work by source, length, language, complexity, and business importance. Include normal inputs, incomplete inputs, and inputs the system should decline. Keep entire related entities together when splitting data so that near duplicates or repeated customers do not create misleading independence.&lt;/p&gt;

&lt;p&gt;Separate development cases from a final held-out evaluation. Prompts, thresholds, preprocessing, and model choice are all fitted decisions when they are adjusted in response to examples. Repeatedly looking at a held-out score turns it into another development signal. Preserve an untouched set for the final comparison, then collect new evidence after deployment.&lt;/p&gt;

&lt;p&gt;For classification, publish a confusion matrix and the performance of important slices. For generation, define a rubric with concrete examples of acceptable and unacceptable answers. Blind the reviewers to candidate identity where practical. Record disagreements and resolve rubric ambiguities before treating small score differences as meaningful.&lt;/p&gt;

&lt;h2 id=&quot;price-the-error-and-the-review-work&quot;&gt;Price the error and the review work&lt;/h2&gt;

&lt;p&gt;Suppose, purely as an illustration, 10,000 documents arrive daily. Candidate A saves two seconds per document but creates 100 additional manual exceptions. If an exception takes five minutes, the added review is 500 minutes per day; the time saved is about 333 minutes. The faster model has increased the total labor requirement.&lt;/p&gt;

&lt;p&gt;Use a cost model that includes serving, review, reprocessing, storage, operational support, and the impact of mistakes. A threshold should reflect those consequences. Do not assign a dollar figure to an uncertain harm just to make a spreadsheet appear precise; identify the uncertainty and test the operational response instead.&lt;/p&gt;

&lt;p&gt;Where errors affect people or expensive actions, inspect which populations or work categories experience the errors. A good aggregate can coexist with an unusable result on the slice that matters most.&lt;/p&gt;

&lt;h2 id=&quot;measure-performance-under-the-intended-workload&quot;&gt;Measure performance under the intended workload&lt;/h2&gt;

&lt;p&gt;Use the expected distribution of request sizes and simultaneous users. Report median and tail latency, rejected requests, timeouts, and throughput within the latency objective. For generated output, distinguish time to first output from time to completion. A short demonstration answer does not represent a long document workload.&lt;/p&gt;

&lt;p&gt;Include validation and downstream work in the measurement. If an answer requires a repair call or operator correction, count that. If a model needs more retrieval context to meet quality requirements, include that context in its memory and latency profile.&lt;/p&gt;

&lt;p&gt;Choose a capacity margin intentionally. The smallest deployment that survives an average load test may have no room for retries, a failed replica, or a sudden burst.&lt;/p&gt;

&lt;h2 id=&quot;select-a-model-you-can-operate&quot;&gt;Select a model you can operate&lt;/h2&gt;

&lt;p&gt;For the finalists, rehearse a version change, a failed dependency, and a rollback. Identify who owns evaluation cases, who can change the model, and who responds when the service produces valid-looking but incorrect output.&lt;/p&gt;

&lt;p&gt;Record the exact model revision, preprocessing, prompt or feature pipeline, runtime, and acceptance thresholds. Schedule a review trigger such as a changed task, changed input distribution, revoked artifact availability, or measured quality regression. The &lt;a href=&quot;https://research.google/pubs/the-ml-test-score-a-rubric-for-ml-production-readiness-and-technical-debt-reduction/&quot;&gt;2017 ML Test Score&lt;/a&gt; provides a production-readiness rubric; the decision gates here are a proposed way to apply that concern to selection.&lt;/p&gt;

&lt;p&gt;Leave enough detail for the next engineer to rerun the comparison and understand the choice. When the workload or input data changes, that record will show which assumptions need checking again.&lt;/p&gt;
</content>
  </entry>
</feed>
