Fix error when max_memory argument is in unexpected order (#1759)
* sort the user-provided max_memory keys in gpu-cpu-disk order
* fixed the bug by adding disk to main devices
* add checking for max_memory argument
* Update src/accelerate/utils/modeling.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/accelerate/utils/modeling.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/accelerate/utils/modeling.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* fix typo
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* fix typos
---------
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>