{"record":{"id":"c9a1a2bea1bbe466","repo":"jax-ml/jax","slug":"vmem-limit-bytes-must-be-an-int-provided-with-a","errorCode":null,"errorMessage":"vmem_limit_bytes must be an int: provided with a {type(vmem_limit_bytes)}.","messagePattern":"vmem_limit_bytes must be an int: provided with a (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/tpu_custom_call.py","lineNumber":800,"sourceCode":"        ctx.module_context.pallas_collective_id_mapping.manual[key] = (\n            collective_id\n        )\n        ctx.module_context.pallas_collective_id_mapping.all_ids.add(\n            collective_id\n        )\n\n    if collective_id is None:\n      raise ValueError(\n          \"collective_id has to be specified when using a custom barrier \"\n          \"(cannot auto-allocate without lowering context)\"\n      )\n  elif collective_id is not None and not allow_collective_id_without_custom_barrier:\n    raise ValueError(\n        \"collective_id has to be unspecified or None when not using a custom\"\n        \" barrier\"\n    )\n  if vmem_limit_bytes is not None and not isinstance(vmem_limit_bytes, int):\n    raise ValueError(\n        \"vmem_limit_bytes must be an int: provided with a\"\n        f\" {type(vmem_limit_bytes)}.\"\n    )\n  if tiling is not None and  device_type != \"sparsecore\":\n    raise ValueError(\n        \"explicit tiling is only supported for SparseCore kernels.\"\n    )\n  if opt_level is not None and device_type != \"sparsecore\":\n    raise ValueError(\n        \"explicit opt_level is only supported for SparseCore kernels.\"\n    )\n  return CustomCallBackendConfig(\n      lowered_module_asm,\n      lowered_module_asm_version,\n      has_communication,\n      collective_id,\n      device_type,\n      cost_estimate,","sourceCodeStart":782,"sourceCodeEnd":818,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/tpu_custom_call.py#L782-L818","documentation":"vmem_limit_bytes was passed with a non-int type (e.g. float, numpy scalar, string) to the TPU kernel lowering config.","triggerScenarios":"Passing vmem_limit_bytes=1e6 or np.int64(...) or '1024' in compiler params.","commonSituations":"Reading config from YAML/JSON where numbers parse as float/str; numpy scalars from config math.","solutions":["Coerce to int: vmem_limit_bytes=int(value)","Validate config values before passing"],"exampleFix":"// before\ncfg = dict(vmem_limit_bytes=1e6)\n// after\ncfg = dict(vmem_limit_bytes=int(1e6))","handlingStrategy":"type-guard","validationCode":"vmem_limit_bytes = int(vmem_limit_bytes) if vmem_limit_bytes is not None else None","typeGuard":"def valid_vmem(v): return v is None or (isinstance(v, int) and not isinstance(v, bool))","tryCatchPattern":null,"preventionTips":["Coerce config-file numbers to int","Reject numpy scalars at config load"],"tags":["tpu","pallas","vmem","type-error","config"],"backgroundTag":"invalid-argument-type","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}