# ValueError (unknown key enable\_cpu\_affinity) on SageMaker for Accelerate \>=0.29.0

**URL:** <https://discuss.huggingface.co/t/valueerror-unknown-key-enable-cpu-affinity-on-sagemaker-for-accelerate-0-29-0/85680>\
**Category:** 🤗Accelerate\
**Created:** [May 7, 2024, 5:28pm UTC](https://discuss.huggingface.co/t/valueerror-unknown-key-enable-cpu-affinity-on-sagemaker-for-accelerate-0-29-0/85680 "2024-05-07T17:28:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![neha-carbon](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@neha-carbon](https://discuss.huggingface.co/u/neha-carbon)\
**Post date:** [May 7, 2024, 5:28pm UTC](https://discuss.huggingface.co/t/valueerror-unknown-key-enable-cpu-affinity-on-sagemaker-for-accelerate-0-29-0/85680/1 "2024-05-07T17:28:14Z")

</div>

Hi all,

I encountered the following error on accelerate version 0.30.0

```auto
ValueError: The config file at ./accelerate_config.yaml had unknown keys (['enable_cpu_affinity']), please try upgrading your `accelerate` version or fix (and potentially remove) these keys from your config file. 

```

The weird part, I did not have this key in my config file at all!

I traced back the error to [this line](https://github.com/huggingface/accelerate/blob/e82de1215ae701b6bf567eb705615c656e7f55c7/src/accelerate/commands/config/config_args.py#L148), which adds the enable\_cpu\_affinity key. Looks like this key was not added in the **SageMakerConfig** class [here](https://github.com/huggingface/accelerate/blob/e82de1215ae701b6bf567eb705615c656e7f55c7/src/accelerate/commands/config/config_args.py#L228) (though it was added for the **ClusterConfig** class on line 185. This is causing us to hit the Value Error condition on line 152.

For now, I am using accelerate 0.28.0 to work around this issue, as this change was introduced to accelerate on May 20. Hoping the HF team can resolve this for the latest version!

---

<div class="post-metadata">

**Author:** ![silsever](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/silsever/32/26822_2.png) [@silsever](https://discuss.huggingface.co/u/silsever)\
**Post date:** [May 10, 2024, 10:36am UTC](https://discuss.huggingface.co/t/valueerror-unknown-key-enable-cpu-affinity-on-sagemaker-for-accelerate-0-29-0/85680/2 "2024-05-10T10:36:45Z")

</div>

I have the same error on accelerate 0.28.0.  
How did you worked around this issue?

---

<div class="post-metadata">

**Author:** ![muellerzr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/muellerzr/32/21583_2.png) [@muellerzr](https://discuss.huggingface.co/u/muellerzr)\
**Post date:** [May 22, 2024, 12:59am UTC](https://discuss.huggingface.co/t/valueerror-unknown-key-enable-cpu-affinity-on-sagemaker-for-accelerate-0-29-0/85680/3 "2024-05-22T00:59:13Z")

</div>

Please update your accelerate version, we released a patch which fixed it!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](https://discuss.huggingface.co/u/system)\
**Post date:** [May 22, 2024, 4:12pm UTC](https://discuss.huggingface.co/t/valueerror-unknown-key-enable-cpu-affinity-on-sagemaker-for-accelerate-0-29-0/85680/4 "2024-05-22T16:12:35Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
