{"record":{"id":"7c19a4c43a35a058","repo":"xai-org/x-algorithm","slug":"concurrent-bytes-must-be-0-got-concurrent-byte","errorCode":null,"errorMessage":"concurrent_bytes must be > 0, got {concurrent_bytes}","messagePattern":"concurrent_bytes must be > 0, got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/utils/checkpointing.py","lineNumber":121,"sourceCode":"            save_concurrent_gb,\n            _CHECKPOINTER_SAVE_CONCURRENT_GB,\n        )\n    return _CHECKPOINTER\n\n\nclass NoCompressionArrayHandler(ocp.type_handlers.ArrayHandler):\n    def _get_json_tspec_write(self, *args, **kwargs):\n        spec = super()._get_json_tspec_write(*args, **kwargs)\n        for codec in spec[\"metadata\"][\"codecs\"]:\n            cfg = codec[\"configuration\"]\n            cfg[\"codecs\"] = [c for c in cfg[\"codecs\"] if c[\"name\"] != \"zstd\"]\n        return spec\n\n\nclass ThrottledD2HArrayHandler(ocp.type_handlers.ArrayHandler):\n    def __init__(self, concurrent_bytes: int, **kwargs):\n        if concurrent_bytes <= 0:\n            raise ValueError(f\"concurrent_bytes must be > 0, got {concurrent_bytes}\")\n        super().__init__(**kwargs)\n        self._concurrent_bytes = concurrent_bytes\n\n    def _addressable_nbytes(self, arr: jax.Array) -> int:\n        total = 0\n        for shard in arr.addressable_shards:\n            if self._replica_id is None or shard.replica_id == self._replica_id:\n                total += int(shard.data.nbytes)\n        return total\n\n    async def serialize(self, values, infos, args=None):\n        args = args or [ocp.SaveArgs()] * len(values)\n        if not values:\n            return []\n\n        batches: list[tuple[list, list, list]] = []\n        cur_v: list = []\n        cur_i: list = []","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/utils/checkpointing.py#L103-L139","documentation":"ThrottledD2HArrayHandler throttles device-to-host transfers by limiting concurrent bytes, so a non-positive limit is meaningless and rejected in __init__. The value typically derives from save_concurrent_gb converted to bytes.","triggerScenarios":"Constructing the handler with concurrent_bytes <= 0, e.g. save_concurrent_gb=0 or a negative value, or a bytes-conversion bug producing 0.","commonSituations":"Config with save_concurrent_gb: 0 meant to 'disable' throttling; integer underflow/unit conversion mistakes (GB vs GiB vs bytes).","solutions":["Set save_concurrent_gb to a positive value (e.g. 2), or pass None to disable throttling entirely","Check the conversion code that turns GB into concurrent_bytes for unit errors"],"exampleFix":"# before\ncheckpointer = get_checkpointer(save_concurrent_gb=0)\n# after\ncheckpointer = get_checkpointer(save_concurrent_gb=2)  # or None to disable throttle","handlingStrategy":"validation","validationCode":"if save_concurrent_gb is not None:\n    assert save_concurrent_gb > 0, 'save_concurrent_gb must be positive or None'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use None to disable throttling, never 0","Validate GB->bytes conversion helpers with unit tests","Assert positivity at config load, not deep in the handler"],"tags":["config-validation","checkpointing","orbax"],"backgroundTag":"invalid-config-value","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}