{"record":{"id":"3908251974304103","repo":"huggingface/transformers","slug":"the-device-map-does-not-contain-the-module-para","errorCode":null,"errorMessage":"The `device_map` does not contain the module {param}.","messagePattern":"The `device_map` does not contain the module (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/transformers/integrations/accelerate.py","lineNumber":895,"sourceCode":"        )\n        logger.info(\n            f\"Based on the current allocation process, no modules could be assigned to the following devices due to \"\n            f\"insufficient memory:\\n\"\n            f\"{devices_info}\\n\"\n            f\"These minimum requirements are specific to this allocation attempt and may vary. Consider increasing \"\n            f\"the available memory for these devices to at least the specified minimum, or adjusting the model config.\"\n        )\n\n    check_tied_parameters_on_same_device(tied_parameters, device_map)\n    return device_map\n\n\ndef _get_param_device(param, device_map):\n    if param in device_map:\n        return device_map[param]\n    parent_param = \".\".join(param.split(\".\")[:-1])\n    if parent_param == param:\n        raise ValueError(f\"The `device_map` does not contain the module {param}.\")\n    else:\n        return _get_param_device(parent_param, device_map)\n\n\ndef check_tied_parameters_on_same_device(tied_params, device_map):\n    \"\"\"\n    Check if tied parameters are on the same device\n\n    Args:\n        tied_params (`List[List[str]]`):\n            A list of lists of parameter names being all tied together.\n\n        device_map (`Dict[str, Union[int, str, torch.device]]`):\n            A map that specifies where each submodule should go.\n\n    \"\"\"\n    for tie_param in tied_params:\n        tie_param_devices = {}","sourceCodeStart":877,"sourceCodeEnd":913,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/integrations/accelerate.py#L877-L913","documentation":"Error \"The `device_map` does not contain the module {param}.\" thrown in huggingface/transformers.","triggerScenarios":"Raised in get_module_from_name / device lookup when a parameter's module is absent from the device_map.","commonSituations":"A custom or incomplete device_map dict that omits modules present in the model.","solutions":["Add the missing module to the device_map, or use device_map='auto' to cover all modules."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}