System Info
- `Accelerate` version: 0.19.0
- Platform: macOS-13.3.1-arm64-arm-64bit
- Python version: 3.11.3
- Numpy version: 1.24.3
- PyTorch version (GPU?): 2.0.1 (False)
- System RAM: 32.00 GB
- `Accelerate` default config:
- compute_environment: LOCAL_MACHINE
- distributed_type: NO
- mixed_precision: no
- use_cpu: False
- num_processes: 1
- machine_rank: 0
- num_machines: 1
- rdzv_backend: static
- same_network: True
- main_training_function: main
- downcast_bf16: no
- tpu_use_cluster: False
- tpu_use_sudo: False
- tpu_env: []
- dynamo_config: {'dynamo_backend': 'INDUCTOR'}
Information
Tasks
Reproduction
Logger used beforehand
Device is set to MPS, although we set cpu to True.
from accelerate import Accelerator
from accelerate.logging import get_logger
logger = get_logger(__name__)
logger.warning(f"Starting test")
accelerator = Accelerator(cpu=True)
print(f"Device: {accelerator.state.device}")
Output:
Starting test
Device: mps
Logger NOT used beforehand
Device is set to CPU, as expected.
from accelerate import Accelerator
from accelerate.logging import get_logger
logger = get_logger(__name__)
# logger.warning(f"Starting test")
accelerator = Accelerator(cpu=True)
print(f"Device: {accelerator.state.device}")
Output:
Expected behavior
I would expect that whenever cpu=True then device should always be CPU. Also, if I pass a certain device it should use that device. I don't see why using the logger beforehand would have any impact on that.
System Info
Information
Tasks
no_trainerscript in theexamplesfolder of thetransformersrepo (such asrun_no_trainer_glue.py)Reproduction
Logger used beforehand
Device is set to MPS, although we set
cputoTrue.Output:
Logger NOT used beforehand
Device is set to CPU, as expected.
Output:
Expected behavior
I would expect that whenever cpu=True then device should always be CPU. Also, if I pass a certain device it should use that device. I don't see why using the logger beforehand would have any impact on that.