{"record":{"id":"21594be0f81eb09b","repo":"huggingface/transformers","slug":"trainer-config-process-wasn-t-called-yet-to-tell","errorCode":null,"errorMessage":"trainer_config_process() wasn't called yet to tell dtype","messagePattern":"trainer_config_process\\(\\) wasn't called yet to tell dtype","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/transformers/integrations/deepspeed.py","lineNumber":95,"sourceCode":"        dep_version_check(\"accelerate\")\n        dep_version_check(\"deepspeed\")\n        super().__init__(config_file_or_dict)\n\n\nclass HfTrainerDeepSpeedConfig(HfDeepSpeedConfig):\n    \"\"\"\n    The `HfTrainerDeepSpeedConfig` object is meant to be created during `TrainingArguments` object creation and has the\n    same lifespan as the latter.\n    \"\"\"\n\n    def __init__(self, config_file_or_dict):\n        super().__init__(config_file_or_dict)\n        self._dtype = None\n        self.mismatches = []\n\n    def dtype(self):\n        if self._dtype is None:\n            raise ValueError(\"trainer_config_process() wasn't called yet to tell dtype\")\n        return self._dtype\n\n    def is_auto(self, ds_key_long):\n        val = self.get_value(ds_key_long)\n        if val is None:\n            return False\n        else:\n            return val == \"auto\"\n\n    def fill_match(self, ds_key_long, hf_val, hf_key=None, must_match=True):\n        \"\"\"\n        A utility method that massages the config file and can optionally verify that the values match.\n\n        1. Replace \"auto\" values with `TrainingArguments` value.\n\n        2. If it wasn't \"auto\" and `must_match` is true, then check that DS config matches Trainer\n        config values and if mismatched add the entry to `self.mismatched` - will assert during\n        `trainer_config_finalize` for one or more mismatches.","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/integrations/deepspeed.py#L77-L113","documentation":"Error \"trainer_config_process() wasn't called yet to tell dtype\" thrown in huggingface/transformers.","triggerScenarios":"Raised in DeepSpeed integration when dtype is queried before trainer_config_process() finalized the config.","commonSituations":"Accessing the HfDeepSpeedConfig dtype before Trainer has processed the DeepSpeed config.","solutions":["Create the HfDeepSpeedConfig via `HfDeepSpeedConfig(ds_config)` (which calls trainer_config_process) before model init."],"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-15T22:17:37.221Z"}