Training requires upgrading transformers from 4.49.0 due to dtype mismatch error, causing potential performance concerns
Excellent work! However, I'm encountering an environment-related issue. I would greatly appreciate your help in resolving it.
I set up the environment according to your configuration in setup.sh:
Package Version Editable project location
--------------------------------- ------------- -----------------------------------------------
accelerate 1.4.0
aiohappyeyeballs 2.6.1
aiohttp 3.11.18
aiohttp-cors 0.8.1
aiosignal 1.3.2
airportsdata 20250224
annotated-types 0.7.0
antlr4-python3-runtime 4.13.2
anyio 4.9.0
astor 0.8.1
async-timeout 5.0.1
attrs 25.3.0
av 14.3.0
bitsandbytes 0.45.5
black 25.1.0
blake3 1.0.4
cachetools 5.5.2
certifi 2025.4.26
charset-normalizer 3.4.2
click 8.1.8
cloudpickle 3.1.1
colorful 0.5.6
compressed-tensors 0.9.1
datasets 3.6.0
deepspeed 0.15.4
depyf 0.18.0
dill 0.3.8
diskcache 5.6.3
distlib 0.3.9
distro 1.9.0
docker-pycreds 0.4.0
einops 0.8.1
exceptiongroup 1.2.2
fastapi 0.115.12
filelock 3.18.0
flake8 7.2.0
flash_attn 2.7.4.post1
frozenlist 1.6.0
fsspec 2025.3.0
gguf 0.10.0
gitdb 4.0.12
GitPython 3.1.44
google-api-core 2.24.2
google-auth 2.40.1
googleapis-common-protos 1.70.0
grpcio 1.71.0
h11 0.16.0
hf_transfer 0.1.9
hf-xet 1.1.0
hjson 3.1.0
httpcore 1.0.9
httptools 0.6.4
httpx 0.28.1
huggingface-hub 0.31.1
idna 3.10
importlib_metadata 8.7.0
iniconfig 2.1.0
inquirerpy 0.3.4
interegular 0.3.3
isort 6.0.1
Jinja2 3.1.6
jiter 0.9.0
jsonschema 4.23.0
jsonschema-specifications 2025.4.1
lark 1.2.2
latex2sympy2_extended 1.10.1
liger_kernel 0.5.2
lm-format-enforcer 0.10.11
markdown-it-py 3.0.0
MarkupSafe 3.0.2
math-verify 0.7.0
mccabe 0.7.0
mdurl 0.1.2
mistral_common 1.5.4
mpmath 1.3.0
msgpack 1.1.0
msgspec 0.19.0
multidict 6.4.3
multiprocess 0.70.16
mypy_extensions 1.1.0
nest-asyncio 1.6.0
networkx 3.4.2
ninja 1.11.1.4
numpy 1.26.4
nvidia-cublas-cu12 12.4.5.8
nvidia-cuda-cupti-cu12 12.4.127
nvidia-cuda-nvrtc-cu12 12.4.127
nvidia-cuda-runtime-cu12 12.4.127
nvidia-cudnn-cu12 9.1.0.70
nvidia-cufft-cu12 11.2.1.3
nvidia-cufile-cu12 1.11.1.6
nvidia-curand-cu12 10.3.5.147
nvidia-cusolver-cu12 11.6.1.9
nvidia-cusparse-cu12 12.3.1.170
nvidia-cusparselt-cu12 0.6.3
nvidia-ml-py 12.575.51
nvidia-nccl-cu12 2.21.5
nvidia-nvjitlink-cu12 12.4.127
nvidia-nvtx-cu12 12.4.127
open-r1 0.1.0.dev0 /data1_hdd/yaxiong/zyc_temp/UI-R1/src/ui_r1/src
openai 1.77.0
opencensus 0.11.4
opencensus-context 0.1.3
opencv-python-headless 4.11.0.86
outlines 0.1.11
outlines_core 0.1.26
packaging 25.0
pandas 2.2.3
parameterized 0.9.0
partial-json-parser 0.2.1.1.post5
pathspec 0.12.1
pfzy 0.3.4
pillow 11.2.1
pip 25.1
platformdirs 4.3.8
pluggy 1.5.0
prometheus_client 0.21.1
prometheus-fastapi-instrumentator 7.1.0
prompt_toolkit 3.0.51
propcache 0.3.1
proto-plus 1.26.1
protobuf 5.29.4
psutil 7.0.0
py-cpuinfo 9.0.0
py-spy 0.4.0
pyarrow 20.0.0
pyasn1 0.6.1
pyasn1_modules 0.4.2
pycodestyle 2.13.0
pycountry 24.6.1
pydantic 2.11.4
pydantic_core 2.33.2
pyflakes 3.3.2
Pygments 2.19.1
pytest 8.3.5
python-dateutil 2.9.0.post0
python-dotenv 1.1.0
pytz 2025.2
PyYAML 6.0.2
pyzmq 26.4.0
qwen-vl-utils 0.0.11
ray 2.46.0
referencing 0.36.2
regex 2024.11.6
requests 2.32.3
rich 14.0.0
rpds-py 0.24.0
rsa 4.9.1
safetensors 0.5.3
sentencepiece 0.2.0
sentry-sdk 2.27.0
setproctitle 1.3.6
setuptools 78.1.1
six 1.17.0
smart-open 7.1.0
smmap 5.0.2
sniffio 1.3.1
starlette 0.46.2
sympy 1.13.1
tensorboardX 2.6.2.2
tiktoken 0.9.0
tokenizers 0.21.1
tomli 2.2.1
torch 2.5.1
torchaudio 2.5.1
torchvision 0.20.1
tqdm 4.67.1
transformers 4.49.0
triton 3.1.0
trl 0.16.0
typing_extensions 4.13.2
typing-inspection 0.4.0
tzdata 2025.2
urllib3 2.4.0
uvicorn 0.34.2
uvloop 0.21.0
virtualenv 20.31.1
vllm 0.7.2
wandb 0.18.3
watchfiles 1.0.5
wcwidth 0.2.13
websockets 15.0.1
wheel 0.45.1
wrapt 1.17.2
xformers 0.0.28.post3
xgrammar 0.1.19
xxhash 3.5.0
yarl 1.20.0
zipp 3.21.0
Run train.sh with this environment will report errors:
[rank1]: AssertionError: Input and cos/sin must have the same dtype, got torch.float32 and torch.bfloat16
I noticed that is a bug from transformers=4.49.0(https://github.com/modelscope/ms-swift/issues/3156) So I upgraded transformers to 4.50.3. At this time, train.sh can run normally, but there will be an environment ERR
open-r1 0.1.0.dev0 requires transformers==4.49.0, but you have transformers 4.50.3 which is incompatible.
So, will using transformers=4.50.3 this way have an impact on model performance? Because I can train normally using this configuration, but after training 8 epochs, the accuracy of the model is only about 20%.
This is outputs of run train.sh using transformers==4.50.3:
W0508 22:47:31.298000 92510 /data1_hdd/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/distributed/run.py:793]
W0508 22:47:31.298000 92510 /data1_hdd/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/distributed/run.py:793] *****************************************
W0508 22:47:31.298000 92510 /data1_hdd/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/distributed/run.py:793] Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
W0508 22:47:31.298000 92510 /data1_hdd/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/distributed/run.py:793] *****************************************
[2025-05-08 22:47:35,443] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[2025-05-08 22:47:35,490] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[2025-05-08 22:47:35,557] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[2025-05-08 22:47:35,570] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[2025-05-08 22:47:35,584] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[2025-05-08 22:47:35,588] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[2025-05-08 22:47:35,683] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[2025-05-08 22:47:35,694] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)
INFO 05-08 22:47:36 __init__.py:190] Automatically detected platform cuda.
INFO 05-08 22:47:36 __init__.py:190] Automatically detected platform cuda.
INFO 05-08 22:47:36 __init__.py:190] Automatically detected platform cuda.
INFO 05-08 22:47:36 __init__.py:190] Automatically detected platform cuda.
INFO 05-08 22:47:36 __init__.py:190] Automatically detected platform cuda.
INFO 05-08 22:47:36 __init__.py:190] Automatically detected platform cuda.
INFO 05-08 22:47:36 __init__.py:190] Automatically detected platform cuda.
INFO 05-08 22:47:37 __init__.py:190] Automatically detected platform cuda.
[2025-05-08 22:47:37,375] [INFO] [comm.py:652:init_distributed] cdb=None
[2025-05-08 22:47:37,375] [INFO] [comm.py:683:init_distributed] Initializing TorchBackend in DeepSpeed with backend nccl
[2025-05-08 22:47:37,417] [INFO] [comm.py:652:init_distributed] cdb=None
[2025-05-08 22:47:37,508] [INFO] [comm.py:652:init_distributed] cdb=None
[2025-05-08 22:47:37,516] [INFO] [comm.py:652:init_distributed] cdb=None
[2025-05-08 22:47:37,645] [INFO] [comm.py:652:init_distributed] cdb=None
[2025-05-08 22:47:37,649] [INFO] [comm.py:652:init_distributed] cdb=None
[2025-05-08 22:47:37,802] [INFO] [comm.py:652:init_distributed] cdb=None
[2025-05-08 22:47:37,820] [INFO] [comm.py:652:init_distributed] cdb=None
Map (num_proc=8): 100%|██████████████████████████████████████████████████████████████████████████| 136/136 [00:00<00:00, 401.12 examples/s]
Map (num_proc=8): 0%| | 0/136 [00:00<?, ? examples/s]using: <class 'open_r1.trainer.grpo_trainer.Qwen2VLGRPOTrainer'>
[2025-05-08 22:47:38,466] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`.
Map (num_proc=8): 100%|██████████████████████████████████████████████████████████████████████████| 136/136 [00:00<00:00, 455.06 examples/s]
Map (num_proc=8): 100%|██████████████████████████████████████████████████████████████████████████| 136/136 [00:00<00:00, 569.96 examples/s]
using: <class 'open_r1.trainer.grpo_trainer.Qwen2VLGRPOTrainer'>
[2025-05-08 22:47:38,812] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
Map (num_proc=8): 100%|██████████████████████████████████████████████████████████████████████████| 136/136 [00:00<00:00, 526.98 examples/s]
You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`.
using: <class 'open_r1.trainer.grpo_trainer.Qwen2VLGRPOTrainer'>
Map (num_proc=8): 100%|██████████████████████████████████████████████████████████████████████████| 136/136 [00:00<00:00, 476.32 examples/s]
[2025-05-08 22:47:38,827] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`.
Map (num_proc=8): 100%|██████████████████████████████████████████████████████████████████████████| 136/136 [00:00<00:00, 512.24 examples/s]
Map (num_proc=8): 100%|██████████████████████████████████████████████████████████████████████████| 136/136 [00:00<00:00, 481.37 examples/s]
using: <class 'open_r1.trainer.grpo_trainer.Qwen2VLGRPOTrainer'>
[2025-05-08 22:47:38,880] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
Map (num_proc=8): 100%|██████████████████████████████████████████████████████████████████████████| 136/136 [00:00<00:00, 444.22 examples/s]
using: <class 'open_r1.trainer.grpo_trainer.Qwen2VLGRPOTrainer'>
You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`.
[2025-05-08 22:47:38,898] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
using: <class 'open_r1.trainer.grpo_trainer.Qwen2VLGRPOTrainer'>
using: <class 'open_r1.trainer.grpo_trainer.Qwen2VLGRPOTrainer'>
You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`.
[2025-05-08 22:47:38,911] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:38,920] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`.
You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`.
using: <class 'open_r1.trainer.grpo_trainer.Qwen2VLGRPOTrainer'>
[2025-05-08 22:47:38,955] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`.
[2025-05-08 22:47:39,813] [INFO] [partition_parameters.py:348:__exit__] finished initializing model - num_params = 825, num_elems = 4.07B
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.04s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.04s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.04s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.05s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.04s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.05s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.04s/it]
[2025-05-08 22:47:45,945] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:45,947] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:45,947] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:45,947] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:45,948] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:45,948] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:45,950] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.10s/it]
[2025-05-08 22:47:46,067] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
Loading checkpoint shards: 0%| | 0/2 [00:00<?, ?it/s][2025-05-08 22:47:46,661] [INFO] [partition_parameters.py:348:__exit__] finished initializing model - num_params = 1650, num_elems = 8.13B
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:05<00:00, 2.93s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:05<00:00, 2.95s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:05<00:00, 2.89s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:05<00:00, 2.95s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:05<00:00, 2.95s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:05<00:00, 2.95s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:05<00:00, 2.95s/it]
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████| 2/2 [00:05<00:00, 2.93s/it]
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
/data1_hdd/yaxiong/zyc_temp/UI-R1/src/ui_r1/src/open_r1/trainer/grpo_trainer.py:397: UserWarning: Setting max_prompt_length is currently not supported, it has been set to None
warnings.warn("Setting max_prompt_length is currently not supported, it has been set to None")
/data1_hdd/yaxiong/zyc_temp/UI-R1/src/ui_r1/src/open_r1/trainer/grpo_trainer.py:397: UserWarning: Setting max_prompt_length is currently not supported, it has been set to None
warnings.warn("Setting max_prompt_length is currently not supported, it has been set to None")
[2025-05-08 22:47:53,130] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:53,135] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
/data1_hdd/yaxiong/zyc_temp/UI-R1/src/ui_r1/src/open_r1/trainer/grpo_trainer.py:397: UserWarning: Setting max_prompt_length is currently not supported, it has been set to None
warnings.warn("Setting max_prompt_length is currently not supported, it has been set to None")
[2025-05-08 22:47:53,153] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
/data1_hdd/yaxiong/zyc_temp/UI-R1/src/ui_r1/src/open_r1/trainer/grpo_trainer.py:397: UserWarning: Setting max_prompt_length is currently not supported, it has been set to None
warnings.warn("Setting max_prompt_length is currently not supported, it has been set to None")
/data1_hdd/yaxiong/zyc_temp/UI-R1/src/ui_r1/src/open_r1/trainer/grpo_trainer.py:397: UserWarning: Setting max_prompt_length is currently not supported, it has been set to None
warnings.warn("Setting max_prompt_length is currently not supported, it has been set to None")
/data1_hdd/yaxiong/zyc_temp/UI-R1/src/ui_r1/src/open_r1/trainer/grpo_trainer.py:397: UserWarning: Setting max_prompt_length is currently not supported, it has been set to None
warnings.warn("Setting max_prompt_length is currently not supported, it has been set to None")
[2025-05-08 22:47:53,172] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:53,173] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:53,175] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
/data1_hdd/yaxiong/zyc_temp/UI-R1/src/ui_r1/src/open_r1/trainer/grpo_trainer.py:397: UserWarning: Setting max_prompt_length is currently not supported, it has been set to None
warnings.warn("Setting max_prompt_length is currently not supported, it has been set to None")
[2025-05-08 22:47:53,197] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
/data1_hdd/yaxiong/zyc_temp/UI-R1/src/ui_r1/src/open_r1/trainer/grpo_trainer.py:397: UserWarning: Setting max_prompt_length is currently not supported, it has been set to None
warnings.warn("Setting max_prompt_length is currently not supported, it has been set to None")
[2025-05-08 22:47:53,277] [INFO] [logging.py:128:log_dist] [Rank 0] DeepSpeed info: version=0.15.4, git-hash=unknown, git-branch=unknown
[2025-05-08 22:47:53,277] [INFO] [config.py:733:__init__] Config mesh_device None world_size = 8
[2025-05-08 22:47:53,292] [INFO] [logging.py:128:log_dist] [Rank 0] DeepSpeed Flops Profiler Enabled: False
[2025-05-08 22:47:53,295] [INFO] [logging.py:128:log_dist] [Rank 0] Creating ZeRO Offload
[2025-05-08 22:47:53,517] [INFO] [utils.py:781:see_memory_usage] DeepSpeedZeRoOffload initialize [begin]
[2025-05-08 22:47:53,517] [INFO] [utils.py:782:see_memory_usage] MA 1.77 GB Max_MA 2.93 GB CA 3.46 GB Max_CA 3 GB
[2025-05-08 22:47:53,517] [INFO] [utils.py:789:see_memory_usage] CPU Virtual Memory: used = 27.83 GB, percent = 5.5%
Parameter Offload: Total persistent parameters: 755712 in 408 params
[2025-05-08 22:47:53,708] [INFO] [utils.py:781:see_memory_usage] DeepSpeedZeRoOffload initialize [end]
[2025-05-08 22:47:53,709] [INFO] [utils.py:782:see_memory_usage] MA 1.77 GB Max_MA 1.77 GB CA 3.46 GB Max_CA 3 GB
[2025-05-08 22:47:53,709] [INFO] [utils.py:789:see_memory_usage] CPU Virtual Memory: used = 27.91 GB, percent = 5.5%
[2025-05-08 22:47:53,711] [INFO] [config.py:999:print] DeepSpeedEngine configuration:
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] activation_checkpointing_config {
"partition_activations": false,
"contiguous_memory_optimization": false,
"cpu_checkpointing": false,
"number_checkpoints": null,
"synchronize_checkpoint_boundary": false,
"profile": false
}
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] aio_config ................... {'block_size': 1048576, 'queue_depth': 8, 'thread_count': 1, 'single_submit': False, 'overlap_events': True, 'use_gds': False}
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] amp_enabled .................. False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] amp_params ................... False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] autotuning_config ............ {
"enabled": false,
"start_step": null,
"end_step": null,
"metric_path": null,
"arg_mappings": null,
"metric": "throughput",
"model_info": null,
"results_dir": "autotuning_results",
"exps_dir": "autotuning_exps",
"overwrite": true,
"fast": true,
"start_profile_step": 3,
"end_profile_step": 5,
"tuner_type": "gridsearch",
"tuner_early_stopping": 5,
"tuner_num_trials": 50,
"model_info_path": null,
"mp_size": 1,
"max_train_batch_size": null,
"min_train_batch_size": 1,
"max_train_micro_batch_size_per_gpu": 1.024000e+03,
"min_train_micro_batch_size_per_gpu": 1,
"num_tuning_micro_batch_sizes": 3
}
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] bfloat16_enabled ............. True
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] bfloat16_immediate_grad_update False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] checkpoint_parallel_write_pipeline False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] checkpoint_tag_validation_enabled True
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] checkpoint_tag_validation_fail False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] comms_config ................. <deepspeed.comm.config.DeepSpeedCommsConfig object at 0x798af5b43820>
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] communication_data_type ...... None
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] compression_config ........... {'weight_quantization': {'shared_parameters': {'enabled': False, 'quantizer_kernel': False, 'schedule_offset': 0, 'quantize_groups': 1, 'quantize_verbose': False, 'quantization_type': 'symmetric', 'quantize_weight_in_forward': False, 'rounding': 'nearest', 'fp16_mixed_quantize': False, 'quantize_change_ratio': 0.001}, 'different_groups': {}}, 'activation_quantization': {'shared_parameters': {'enabled': False, 'quantization_type': 'symmetric', 'range_calibration': 'dynamic', 'schedule_offset': 1000}, 'different_groups': {}}, 'sparse_pruning': {'shared_parameters': {'enabled': False, 'method': 'l1', 'schedule_offset': 1000}, 'different_groups': {}}, 'row_pruning': {'shared_parameters': {'enabled': False, 'method': 'l1', 'schedule_offset': 1000}, 'different_groups': {}}, 'head_pruning': {'shared_parameters': {'enabled': False, 'method': 'topk', 'schedule_offset': 1000}, 'different_groups': {}}, 'channel_pruning': {'shared_parameters': {'enabled': False, 'method': 'l1', 'schedule_offset': 1000}, 'different_groups': {}}, 'layer_reduction': {'enabled': False}}
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] curriculum_enabled_legacy .... False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] curriculum_params_legacy ..... False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] data_efficiency_config ....... {'enabled': False, 'seed': 1234, 'data_sampling': {'enabled': False, 'num_epochs': 1000, 'num_workers': 0, 'curriculum_learning': {'enabled': False}}, 'data_routing': {'enabled': False, 'random_ltd': {'enabled': False, 'layer_token_lr_schedule': {'enabled': False}}}}
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] data_efficiency_enabled ...... False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] dataloader_drop_last ......... False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] disable_allgather ............ False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] dump_state ................... False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] dynamic_loss_scale_args ...... None
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] eigenvalue_enabled ........... False
[2025-05-08 22:47:53,711] [INFO] [config.py:1003:print] eigenvalue_gas_boundary_resolution 1
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] eigenvalue_layer_name ........ bert.encoder.layer
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] eigenvalue_layer_num ......... 0
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] eigenvalue_max_iter .......... 100
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] eigenvalue_stability ......... 1e-06
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] eigenvalue_tol ............... 0.01
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] eigenvalue_verbose ........... False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] elasticity_enabled ........... False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] flops_profiler_config ........ {
"enabled": false,
"recompute_fwd_factor": 0.0,
"profile_step": 1,
"module_depth": -1,
"top_modules": 1,
"detailed": true,
"output_file": null
}
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] fp16_auto_cast ............... None
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] fp16_enabled ................. False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] fp16_master_weights_and_gradients False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] global_rank .................. 0
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] grad_accum_dtype ............. None
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] gradient_accumulation_steps .. 2
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] gradient_clipping ............ 1.0
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] gradient_predivide_factor .... 1.0
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] graph_harvesting ............. False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] hybrid_engine ................ enabled=False max_out_tokens=512 inference_tp_size=1 release_inference_cache=False pin_parameters=True tp_gather_partition_size=8
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] initial_dynamic_scale ........ 1
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] load_universal_checkpoint .... False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] loss_scale ................... 1.0
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] memory_breakdown ............. False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] mics_hierarchial_params_gather False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] mics_shard_size .............. -1
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] monitor_config ............... tensorboard=TensorBoardConfig(enabled=False, output_path='', job_name='DeepSpeedJobName') comet=CometConfig(enabled=False, samples_log_interval=100, project=None, workspace=None, api_key=None, experiment_name=None, experiment_key=None, online=None, mode=None) wandb=WandbConfig(enabled=False, group=None, team=None, project='deepspeed') csv_monitor=CSVConfig(enabled=False, output_path='', job_name='DeepSpeedJobName')
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] nebula_config ................ {
"enabled": false,
"persistent_storage_path": null,
"persistent_time_interval": 100,
"num_of_version_in_retention": 2,
"enable_nebula_load": true,
"load_path": null
}
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] optimizer_legacy_fusion ...... False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] optimizer_name ............... None
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] optimizer_params ............. None
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] pipeline ..................... {'stages': 'auto', 'partition': 'best', 'seed_layers': False, 'activation_checkpoint_interval': 0, 'pipe_partitioned': True, 'grad_partitioned': True}
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] pld_enabled .................. False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] pld_params ................... False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] prescale_gradients ........... False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] scheduler_name ............... None
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] scheduler_params ............. None
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] seq_parallel_communication_data_type torch.float32
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] sparse_attention ............. None
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] sparse_gradients_enabled ..... False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] steps_per_print .............. inf
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] timers_config ................ enabled=True synchronized=True
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] train_batch_size ............. 16
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] train_micro_batch_size_per_gpu 1
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] use_data_before_expert_parallel_ False
[2025-05-08 22:47:53,712] [INFO] [config.py:1003:print] use_node_local_storage ....... False
[2025-05-08 22:47:53,713] [INFO] [config.py:1003:print] wall_clock_breakdown ......... False
[2025-05-08 22:47:53,713] [INFO] [config.py:1003:print] weight_quantization_config ... None
[2025-05-08 22:47:53,713] [INFO] [config.py:1003:print] world_size ................... 8
[2025-05-08 22:47:53,713] [INFO] [config.py:1003:print] zero_allow_untested_optimizer False
[2025-05-08 22:47:53,713] [INFO] [config.py:1003:print] zero_config .................. stage=3 contiguous_gradients=True reduce_scatter=True reduce_bucket_size=500000000 use_multi_rank_bucket_allreduce=True allgather_partitions=True allgather_bucket_size=500000000 overlap_comm=True load_from_fp32_weights=True elastic_checkpoint=False offload_param=DeepSpeedZeroOffloadParamConfig(device='none', nvme_path=None, buffer_count=5, buffer_size=100000000, max_in_cpu=1000000000, pin_memory=True) offload_optimizer=DeepSpeedZeroOffloadOptimizerConfig(device='none', nvme_path=None, buffer_count=4, pin_memory=True, pipeline_read=False, pipeline_write=False, fast_init=False, ratio=1.0) sub_group_size=1000000000 cpu_offload_param=None cpu_offload_use_pin_memory=None cpu_offload=None prefetch_bucket_size=50000000 param_persistence_threshold=100000 model_persistence_threshold=9223372036854775807 max_live_parameters=1000000000 max_reuse_distance=1000000000 gather_16bit_weights_on_model_save=True use_all_reduce_for_fetch_params=False stage3_gather_fp16_weights_on_model_save=False ignore_unused_parameters=True legacy_stage1=False round_robin_gradients=False zero_hpz_partition_size=1 zero_quantized_weights=False zero_quantized_nontrainable_weights=False zero_quantized_gradients=False mics_shard_size=-1 mics_hierarchical_params_gather=False memory_efficient_linear=True pipeline_loading_checkpoint=False override_module_apply=True
[2025-05-08 22:47:53,713] [INFO] [config.py:1003:print] zero_enabled ................. True
[2025-05-08 22:47:53,713] [INFO] [config.py:1003:print] zero_force_ds_cpu_optimizer .. True
[2025-05-08 22:47:53,713] [INFO] [config.py:1003:print] zero_optimization_stage ...... 3
[2025-05-08 22:47:53,713] [INFO] [config.py:989:print_user_config] json = {
"fp16": {
"enabled": false,
"loss_scale": 0,
"loss_scale_window": 1000,
"initial_scale_power": 16,
"hysteresis": 2,
"min_loss_scale": 1
},
"bf16": {
"enabled": true
},
"zero_optimization": {
"stage": 3,
"offload_optimizer": {
"device": "none",
"pin_memory": true
},
"offload_param": {
"device": "none",
"pin_memory": true
},
"overlap_comm": true,
"contiguous_gradients": true,
"sub_group_size": 1.000000e+09,
"reduce_bucket_size": "auto",
"stage3_prefetch_bucket_size": "auto",
"stage3_param_persistence_threshold": "auto",
"stage3_max_live_parameters": 1.000000e+09,
"stage3_max_reuse_distance": 1.000000e+09,
"stage3_gather_16bit_weights_on_model_save": true
},
"gradient_accumulation_steps": 2,
"gradient_clipping": 1.0,
"steps_per_print": inf,
"train_batch_size": 16,
"train_micro_batch_size_per_gpu": 1,
"wall_clock_breakdown": false,
"zero_optimization.reduce_bucket_size": 4.194304e+06,
"zero_optimization.stage3_param_persistence_threshold": 2.048000e+04,
"zero_optimization.stage3_prefetch_bucket_size": 3.774874e+06
}
Parameter Offload: Total persistent parameters: 755712 in 408 params
wandb: Using wandb-core as the SDK backend. Please refer to https://wandb.me/wandb-core for more information.
wandb: Currently logged in as: x
wandb: Tracking run with wandb version 0.18.3
wandb: Run data is saved locally in xx
wandb: Run `wandb offline` to turn off syncing.
wandb: Syncing run GRPO_example
wandb: ⭐️ View project at xx
wandb: 🚀 View run at xx
0%| | 0/68 [00:00<?, ?it/s]/home/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/utils/checkpoint.py:87: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn(
/home/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/utils/checkpoint.py:87: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn(
/home/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/utils/checkpoint.py:87: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn(
/home/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/utils/checkpoint.py:87: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn(
/home/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/utils/checkpoint.py:87: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn(
/home/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/utils/checkpoint.py:87: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn(
/home/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/utils/checkpoint.py:87: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn(
/home/yaxiong/miniconda3/envs/uir1/lib/python3.10/site-packages/torch/utils/checkpoint.py:87: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn(
`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...
`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...
`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...
DynamicCache + torch.export is tested on torch 2.6.0+ and may not work on earlier versions.
DynamicCache + torch.export is tested on torch 2.6.0+ and may not work on earlier versions.
DynamicCache + torch.export is tested on torch 2.6.0+ and may not work on earlier versions.
`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...
`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...
`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...
`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...
`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...
DynamicCache + torch.export is tested on torch 2.6.0+ and may not work on earlier versions.
DynamicCache + torch.export is tested on torch 2.6.0+ and may not work on earlier versions.
DynamicCache + torch.export is tested on torch 2.6.0+ and may not work on earlier versions.
DynamicCache + torch.export is tested on torch 2.6.0+ and may not work on earlier versions.
DynamicCache + torch.export is tested on torch 2.6.0+ and may not work on earlier versions.
Invalidate trace cache @ step 0 and module 1746: cache has only 0 modules
Invalidate trace cache @ step 0 and module 2619: cache has only 0 modules
[2025-05-08 22:48:57,498] [WARNING] [stage3.py:2114:step] 1 pytorch allocator cache flushes since last step. this happens when there is high memory pressure and is detrimental to performance. if this is happening frequently consider adjusting settings to reduce memory consumption. If you are unable to make the cache flushes go away consider adding get_accelerator().empty_cache() calls in your training loop to ensure that all ranks flush their caches at the same time
{'loss': 0.0, 'grad_norm': 6.307155175124898, 'learning_rate': 9.85294117647059e-07, 'completion_length': 108.0625, 'rewards/accuracy_reward_action': 0.625, 'rewards/accuracy_reward_coord': 0.25, 'rewards/format_reward': 0.9375, 'reward': 1.8125, 'reward_std': 0.8379841446876526, 'kl': 0.0, 'clip_ratio': 0.0, 'epoch': 0.01}
1%|█▍ | 1/68 [00:57<1:04:11, 57.49s/it]Invalidate trace cache @ step 0 and module 3492: cache has only 0 modules
Invalidate trace cache @ step 0 and module 4365: cache has only 0 modules
[2025-05-08 22:49:50,887] [WARNING] [stage3.py:2114:step] 1 pytorch allocator cache flushes since last step. this happens when there is high memory pressure and is detrimental to performance. if this is happening frequently consider adjusting settings to reduce memory consumption. If you are unable to make the cache flushes go away consider adding get_accelerator().empty_cache() calls in your training loop to ensure that all ranks flush their caches at the same time
{'loss': 0.0, 'grad_norm': 22.80255106241241, 'learning_rate': 9.705882352941176e-07, 'completion_length': 103.0625, 'rewards/accuracy_reward_action': 0.75, 'rewards/accuracy_reward_coord': 0.0625, 'rewards/format_reward': 1.0, 'reward': 1.8125, 'reward_std': 0.5303300768136978, 'kl': 0.0006198883056640625, 'clip_ratio': 0.0, 'epoch': 0.03}
3%|██▉ | 2/68 [01:50<1:00:35, 55.08s/it]Invalidate trace cache @ step 0 and module 5238: cache has only 0 modules
There is a bug of transformers 4.49.0. You can solve it by https://github.com/modelscope/ms-swift/issues/3156. First set transformers == 4.49.0. And modify: qwen2_5_vl/modeling_qwen2_5_vl.py: L168-169: q_embed = apply_rotary_emb(q.float(), cos.float(), sin.float()).type_as(q) k_embed = apply_rotary_emb(k.float(), cos.float(), sin.float()).type_as(k)
L226: cos, sin = cos.unsqueeze(-2).float(), sin.unsqueeze(-2).float()
But I don't know if using transformers=4.50.3 will have an impact on model performance. You can have a try with transformers == 4.49.0. There may be some other reasons that cause the bad accuracy. You can analyse it from the training curves.
Thank you so much for your prompt reply! I’ll try what you suggested. Thanks again!
Thank you so much for your prompt reply! I’ll try what you suggested. Thanks again!
请问您flash_attn直接用setup.py的代码就可以下载嘛?我下载这个一致出现问题,请问您可以给一个您环境的requirements吗?万分感激