执行 python fine-tuning.py 提示
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Unsloth 2024.4 patched 32 layers with 32 QKV layers, 32 O layers and 32 MLP layers.
max_steps is given, it will override any value given in num_train_epochs
==((====))== Unsloth - 2x faster free finetuning | Num GPUs = 1
\ /| Num examples = 1,496 | Num Epochs = 1
O^O/ _/ \ Batch size per device = 2 | Gradient Accumulation steps = 4
\ / Total batch size = 8 | Total steps = 60
"-____-" Number of trainable parameters = 41,943,040
0%| | 0/60 [00:00<?, ?it/s]ptxas info : 11 bytes gmem
ptxas info : Compiling entry function '_rms_layernorm_forward_0d1de2d3de4d5c6d7c8de9' for 'sm_89'
ptxas info : Function properties for _rms_layernorm_forward_0d1de2d3de4d5c6d7c8de9
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 40 registers, 408 bytes cmem[0]
main.c
D:\unsloth\python311\venv\Lib\site-packages\triton\common..\third_party\cuda\include\cuda.h(55): fatal error C1083: 无 法打开包括文件: “stdlib.h”: No such file or directory
Traceback (most recent call last):
File "D:\unsloth\fine-tuning.py", line 83, in
trainer.train()
File "D:\unsloth\python311\venv\Lib\site-packages\trl\trainer\sft_trainer.py", line 361, in train
output = super().train(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\transformers\trainer.py", line 1859, in train
return inner_training_loop(
^^^^^^^^^^^^^^^^^^^^
File "", line 361, in _fast_inner_training_loop
File "D:\unsloth\python311\venv\Lib\site-packages\transformers\trainer.py", line 3138, in training_step
loss = self.compute_loss(model, inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\transformers\trainer.py", line 3161, in compute_loss
outputs = model(**inputs)
^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\accelerate\utils\operations.py", line 822, in forward
return model_forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\accelerate\utils\operations.py", line 810, in call
return convert_to_fp32(self.model_forward(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\amp\autocast_mode.py", line 16, in decorate_autocast
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\unsloth\models\llama.py", line 882, in PeftModelForCausalLM_fast_forward
return self.base_model(
^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\peft\tuners\tuners_utils.py", line 161, in forward
return self.model.forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\accelerate\hooks.py", line 166, in new_forward
output = module._old_forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\unsloth\models\llama.py", line 813, in _CausalLM_fast_forward
outputs = self.model(
^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\accelerate\hooks.py", line 166, in new_forward
output = module._old_forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\unsloth\models\llama.py", line 668, in LlamaModel_fast_forward
layer_outputs = torch.utils.checkpoint.checkpoint(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch_compile.py", line 24, in inner
return torch._dynamo.disable(fn, recursive)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch_dynamo\eval_frame.py", line 489, in _fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch_dynamo\external_utils.py", line 17, in inner
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\utils\checkpoint.py", line 482, in checkpoint
return CheckpointFunction.apply(function, preserve, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\autograd\function.py", line 553, in apply
return super().apply(*args, **kwargs) # type: ignore[misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\utils\checkpoint.py", line 261, in forward
outputs = run_function(*args)
^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\unsloth\models\llama.py", line 664, in custom_forward
return module(*inputs, past_key_value, output_attentions, padding_mask = padding_mask)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\accelerate\hooks.py", line 166, in new_forward
output = module._old_forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\unsloth\models\llama.py", line 432, in LlamaDecoderLayer_fast_forward
hidden_states = fast_rms_layernorm(self.input_layernorm, hidden_states)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\unsloth\kernels\rms_layernorm.py", line 190, in fast_rms_layernorm
out = Fast_RMS_Layernorm.apply(X, W, eps, gemma)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\torch\autograd\function.py", line 553, in apply
return super().apply(*args, **kwargs) # type: ignore[misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\unsloth\kernels\rms_layernorm.py", line 144, in forward
fx[(n_rows,)](
File "D:\unsloth\python311\venv\Lib\site-packages\triton\runtime\jit.py", line 541, in run
self.cache[device][key] = compile(
^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\triton\compiler\compiler.py", line 202, in compile
so_path = backend.make_launcher_stub(src, metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\triton\compiler\backends\cuda.py", line 224, in make_launcher_stub
return make_stub(src.name, src.signature, constants, ids, enable_warp_specialization=enable_warp_specialization)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\triton\compiler\make_launcher.py", line 37, in make_stub
so = _build(name, src_path, tmpdir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\venv\Lib\site-packages\triton\common\build.py", line 124, in _build
ret = subprocess.check_call(cc_cmd)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\unsloth\python311\Lib\subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cl', 'C:\Users\li\AppData\Local\Temp\tmpybvznc3h\main.c', '/nologo', '/O2', '/LD', '/ID:\unsloth\python311\venv\Lib\site-packages\triton\common\..\third_party\cuda\include', '/ID:\unsloth\python311\Include', '/IC:\Users\li\AppData\Local\Temp\tmpybvznc3h', '/link', '/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\lib\x64', '/LIBPATH:D:\unsloth\python311\libs', 'cuda.lib', '/OUT:C:\Users\li\AppData\Local\Temp\tmpybvznc3h\_rms_layernorm_forward.cp311-win_amd64.pyd']' returned non-zero exit status 2.
0%| | 0/60 [00:00<?, ?it/s]