Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
699 commits
Select commit Hold shift + click to select a range
1339306
Update compiler.py
danielhanchen Mar 12, 2025
bee764b
Update patching_utils.py
danielhanchen Mar 12, 2025
800077f
Update patching_utils.py
danielhanchen Mar 12, 2025
83ae6be
Update patching_utils.py
danielhanchen Mar 12, 2025
74c40ab
Update peft_utils.py
danielhanchen Mar 12, 2025
d37e823
Update compiler.py
danielhanchen Mar 12, 2025
e4869ff
Update loss_utils.py
danielhanchen Mar 12, 2025
08c4a4f
Update loss_utils.py
danielhanchen Mar 12, 2025
4e8773a
Merge branch 'main' into nightly
danielhanchen Mar 12, 2025
ea79be4
Merge branch 'main' into nightly
danielhanchen Mar 12, 2025
8bda25a
Update compiler.py
danielhanchen Mar 12, 2025
09f9c7e
Update compiler.py
danielhanchen Mar 12, 2025
acf74ec
Update compiler.py
danielhanchen Mar 12, 2025
c21c990
Update compiler.py
danielhanchen Mar 12, 2025
164cdea
Update compiler.py
danielhanchen Mar 12, 2025
d549aa6
Update compiler.py
danielhanchen Mar 12, 2025
cfb6851
Update compiler.py
danielhanchen Mar 12, 2025
3344d4e
bug fixes
danielhanchen Mar 12, 2025
1d45bfa
Update compiler.py
danielhanchen Mar 12, 2025
de6c061
Update compiler.py
danielhanchen Mar 12, 2025
28e9318
Update vision_utils.py
danielhanchen Mar 12, 2025
bf60148
Update compiler.py
danielhanchen Mar 12, 2025
7739c37
Update loss_utils.py
danielhanchen Mar 12, 2025
3192f8d
Update loss_utils.py
danielhanchen Mar 12, 2025
9f6f012
Update loss_utils.py
danielhanchen Mar 12, 2025
e39740c
Update loss_utils.py
danielhanchen Mar 12, 2025
6e17816
Bug fixes
danielhanchen Mar 13, 2025
f2f1a2e
Update dataset_utils.py
danielhanchen Mar 13, 2025
9889307
Update dataset_utils.py
danielhanchen Mar 13, 2025
b56b523
Update dataset_utils.py
danielhanchen Mar 13, 2025
a7c257a
Update dataset_utils.py
danielhanchen Mar 13, 2025
6556f13
Update dataset_utils.py
danielhanchen Mar 13, 2025
9a05b2f
Update compiler.py
danielhanchen Mar 13, 2025
0f6fc7a
Update compiler.py
danielhanchen Mar 13, 2025
4bb152a
Update compiler.py
danielhanchen Mar 13, 2025
3ccdf86
Update compiler.py
danielhanchen Mar 13, 2025
1783ba1
Update loss_utils.py
danielhanchen Mar 13, 2025
b2983f4
Update loss_utils.py
danielhanchen Mar 13, 2025
3c9c731
Merge branch 'main' into nightly
danielhanchen Mar 13, 2025
4c5c77d
gpu_memory_utilization
danielhanchen Mar 14, 2025
b918327
Update temporary_patches.py
danielhanchen Mar 14, 2025
e8f561c
Update vision_utils.py
danielhanchen Mar 14, 2025
4459ef8
Update vision_utils.py
danielhanchen Mar 14, 2025
62e0e14
Update vision_utils.py
danielhanchen Mar 14, 2025
9f4b729
Update vision_utils.py
danielhanchen Mar 14, 2025
29a7abf
Update vision_utils.py
danielhanchen Mar 14, 2025
9830edd
Update vision_utils.py
danielhanchen Mar 14, 2025
be53fda
Update vision_utils.py
danielhanchen Mar 14, 2025
28f4df4
Update vision_utils.py
danielhanchen Mar 14, 2025
ad13d0a
train on completions VLMs
danielhanchen Mar 14, 2025
370cbd7
Update dataset_utils.py
danielhanchen Mar 14, 2025
bd60d26
Update dataset_utils.py
danielhanchen Mar 14, 2025
29ed559
Update dataset_utils.py
danielhanchen Mar 14, 2025
e0a4416
Update dataset_utils.py
danielhanchen Mar 14, 2025
d6e55ca
VLM train only on completions
danielhanchen Mar 14, 2025
adf8307
Update loss_utils.py
danielhanchen Mar 14, 2025
98d5885
Update dataset_utils.py
danielhanchen Mar 14, 2025
967c2ba
Update compiler.py
danielhanchen Mar 14, 2025
ddf2b8e
Update compiler.py
danielhanchen Mar 14, 2025
cb2f6c7
Update compiler.py
danielhanchen Mar 14, 2025
873c514
Update compiler.py
danielhanchen Mar 14, 2025
ca0b499
Update compiler.py
danielhanchen Mar 14, 2025
4908a16
Update compiler.py
danielhanchen Mar 14, 2025
1d4b5d7
Update compiler.py
danielhanchen Mar 14, 2025
81b45c6
Update saving_utils.py
danielhanchen Mar 14, 2025
261ffd2
Update llama_cpp.py
danielhanchen Mar 14, 2025
2ed281a
Update llama_cpp.py
danielhanchen Mar 14, 2025
d89a8fa
Update saving_utils.py
danielhanchen Mar 14, 2025
106736a
Update saving_utils.py
danielhanchen Mar 14, 2025
4abfdcd
Update __init__.py
danielhanchen Mar 14, 2025
0ac4464
Update compiler.py
danielhanchen Mar 14, 2025
e2fbe79
Update loss_utils.py
danielhanchen Mar 14, 2025
82665d4
Update compiler.py
danielhanchen Mar 14, 2025
9b6142e
Update loss_utils.py
danielhanchen Mar 14, 2025
ee92817
Update loss_utils.py
danielhanchen Mar 14, 2025
9b7600d
Update llama_cpp.py
danielhanchen Mar 14, 2025
d5b6d1c
Update loss_utils.py
danielhanchen Mar 14, 2025
86516ad
Update compiler.py
danielhanchen Mar 14, 2025
29553e4
Update llama_cpp.py
danielhanchen Mar 14, 2025
33e6c8e
Update compiler.py
danielhanchen Mar 14, 2025
5202605
Update vllm_utils.py
danielhanchen Mar 14, 2025
ca52896
Update rl_replacements.py
danielhanchen Mar 14, 2025
7baa442
Update rl_replacements.py
danielhanchen Mar 14, 2025
7ff5a1a
Update rl_replacements.py
danielhanchen Mar 14, 2025
e80aa10
Update rl_replacements.py
danielhanchen Mar 14, 2025
e93d93f
Update rl_replacements.py
danielhanchen Mar 14, 2025
9a6c231
Update rl_replacements.py
danielhanchen Mar 14, 2025
c8abd45
Update training_utils.py
danielhanchen Mar 14, 2025
1633c78
Merge branch 'main' into nightly
danielhanchen Mar 15, 2025
964129b
Update dataset_utils.py
danielhanchen Mar 15, 2025
3b690ad
Update dataset_utils.py
danielhanchen Mar 16, 2025
7bb4a13
Revert "Update dataset_utils.py"
danielhanchen Mar 16, 2025
947c5e9
Update temporary_patches.py
danielhanchen Mar 16, 2025
2fe9c6c
Update temporary_patches.py
danielhanchen Mar 16, 2025
0b2dc97
Update temporary_patches.py
danielhanchen Mar 16, 2025
b9a96dc
Update temporary_patches.py
danielhanchen Mar 16, 2025
0784a07
Update temporary_patches.py
danielhanchen Mar 16, 2025
80c2dc8
Update temporary_patches.py
danielhanchen Mar 16, 2025
26c817d
Update compiler.py
danielhanchen Mar 16, 2025
d3cdd17
Update compiler.py
danielhanchen Mar 16, 2025
31e778a
Remove prints
danielhanchen Mar 16, 2025
2c6a3c5
Update compiler.py
danielhanchen Mar 16, 2025
f3f3c9c
Update saving_utils.py
danielhanchen Mar 16, 2025
93b6a88
Update temporary_patches.py
danielhanchen Mar 16, 2025
86aee5c
Update __init__.py
danielhanchen Mar 16, 2025
ac38bff
Update pyproject.toml
danielhanchen Mar 16, 2025
f64e153
Update vllm_utils.py
danielhanchen Mar 16, 2025
4c72e79
bug fix #2008 unsloth issue - load_in_4bit = True + fast_inference = …
void-mckenzie Mar 16, 2025
1974798
Update dataset_utils.py
danielhanchen Mar 16, 2025
4df4417
Merge branch 'nightly' of https://github.com/unslothai/unsloth-zoo in…
danielhanchen Mar 16, 2025
a5c20e1
Update compiler.py
danielhanchen Mar 17, 2025
a434d45
Update temporary_patches.py
danielhanchen Mar 17, 2025
3cfb98f
Gemma 3 fixes
danielhanchen Mar 17, 2025
fc5f1c0
Update temporary_patches.py
danielhanchen Mar 17, 2025
b317e90
Update compiler.py
danielhanchen Mar 17, 2025
4121dd0
Update compiler.py
danielhanchen Mar 17, 2025
c59dcde
Gemma 3 fixes
danielhanchen Mar 17, 2025
d98ae2e
Update patching_utils.py
danielhanchen Mar 17, 2025
3073ea3
Update compiler.py
danielhanchen Mar 17, 2025
57ff5f6
Update compiler.py
danielhanchen Mar 17, 2025
c7e803b
Update patching_utils.py
danielhanchen Mar 17, 2025
3daaf0d
Update temporary_patches.py
danielhanchen Mar 17, 2025
b619b58
Update compiler.py
danielhanchen Mar 17, 2025
4e78082
Update compiler.py
danielhanchen Mar 17, 2025
c8ba677
Update temporary_patches.py
danielhanchen Mar 17, 2025
fb68ecc
Update temporary_patches.py
danielhanchen Mar 17, 2025
e5a73fe
Update temporary_patches.py
danielhanchen Mar 17, 2025
d7bbe30
Update temporary_patches.py
danielhanchen Mar 17, 2025
5f99275
Update temporary_patches.py
danielhanchen Mar 17, 2025
346812f
Update temporary_patches.py
danielhanchen Mar 17, 2025
b907d0c
Update temporary_patches.py
danielhanchen Mar 17, 2025
789171c
Update temporary_patches.py
danielhanchen Mar 17, 2025
4e2c94a
Update compiler.py
danielhanchen Mar 17, 2025
4740c99
Update compiler.py
danielhanchen Mar 17, 2025
4658d94
Update compiler.py
danielhanchen Mar 17, 2025
f9de6e9
Update compiler.py
danielhanchen Mar 17, 2025
dbdbc63
Update compiler.py
danielhanchen Mar 17, 2025
55b1963
Update compiler.py
danielhanchen Mar 17, 2025
e997ee1
Update compiler.py
danielhanchen Mar 17, 2025
0ba033f
Update compiler.py
danielhanchen Mar 17, 2025
bf821ba
Update compiler.py
danielhanchen Mar 17, 2025
d8c6e59
Update compiler.py
danielhanchen Mar 17, 2025
9967ce3
Update compiler.py
danielhanchen Mar 17, 2025
7b0c535
Update compiler.py
danielhanchen Mar 17, 2025
e6859ce
Update compiler.py
danielhanchen Mar 17, 2025
b2a8f47
Update compiler.py
danielhanchen Mar 17, 2025
ca79c93
Update compiler.py
danielhanchen Mar 17, 2025
3f67ed6
Update compiler.py
danielhanchen Mar 17, 2025
e5fb044
Update compiler.py
danielhanchen Mar 18, 2025
4a1bf2f
Update compiler.py
danielhanchen Mar 18, 2025
36ec4ee
Update compiler.py
danielhanchen Mar 18, 2025
7d1dc81
compiler
danielhanchen Mar 18, 2025
16d6137
Update gradient_checkpointing.py
danielhanchen Mar 18, 2025
9b78566
Update temporary_patches.py
danielhanchen Mar 18, 2025
e0edefe
Update temporary_patches.py
danielhanchen Mar 18, 2025
719e379
Update temporary_patches.py
danielhanchen Mar 18, 2025
8beb2b7
Update temporary_patches.py
danielhanchen Mar 18, 2025
f9cf701
Update temporary_patches.py
danielhanchen Mar 18, 2025
aa8848c
Update temporary_patches.py
danielhanchen Mar 18, 2025
ee940a9
Update temporary_patches.py
danielhanchen Mar 18, 2025
d086158
Update temporary_patches.py
danielhanchen Mar 18, 2025
5a43de2
Update temporary_patches.py
danielhanchen Mar 18, 2025
1f6589b
Update temporary_patches.py
danielhanchen Mar 18, 2025
9b904a9
Update temporary_patches.py
danielhanchen Mar 18, 2025
3c0504b
Update temporary_patches.py
danielhanchen Mar 18, 2025
417161e
Update temporary_patches.py
danielhanchen Mar 18, 2025
3f024b6
Update temporary_patches.py
danielhanchen Mar 18, 2025
b0bd2f4
Update temporary_patches.py
danielhanchen Mar 18, 2025
640e071
Update temporary_patches.py
danielhanchen Mar 18, 2025
05c2232
Update temporary_patches.py
danielhanchen Mar 18, 2025
593eecb
Update temporary_patches.py
danielhanchen Mar 18, 2025
e9c935f
Update temporary_patches.py
danielhanchen Mar 18, 2025
b71160c
causal mask dtype
danielhanchen Mar 18, 2025
a6fedb6
Fix checkpoint and save from local file (#74)
Erland366 Mar 18, 2025
c566b02
Update patching_utils.py
danielhanchen Mar 18, 2025
aaf5feb
Merge branch 'nightly' of https://github.com/unslothai/unsloth-zoo in…
danielhanchen Mar 18, 2025
94f5f4f
Update patching_utils.py
danielhanchen Mar 18, 2025
26c67cf
Update temporary_patches.py
danielhanchen Mar 18, 2025
d92bab6
Update temporary_patches.py
danielhanchen Mar 18, 2025
b04cf4b
Update compiler.py
danielhanchen Mar 18, 2025
4565db3
Update loss_utils.py
danielhanchen Mar 18, 2025
e368810
Update compiler.py
danielhanchen Mar 18, 2025
ce07e0f
Update vllm_utils.py
danielhanchen Mar 18, 2025
114150d
Update compiler.py
danielhanchen Mar 18, 2025
6bd69f1
Update peft_utils.py
danielhanchen Mar 18, 2025
9cee216
Update rl_replacements.py
danielhanchen Mar 18, 2025
df8ac03
Update vllm_utils.py
danielhanchen Mar 18, 2025
e5a321f
Update temporary_patches.py
danielhanchen Mar 18, 2025
134857d
Update temporary_patches.py
danielhanchen Mar 18, 2025
dec6433
Update temporary_patches.py
danielhanchen Mar 18, 2025
b14149b
Update temporary_patches.py
danielhanchen Mar 18, 2025
07f7dde
Update temporary_patches.py
danielhanchen Mar 18, 2025
7600d35
Update temporary_patches.py
danielhanchen Mar 18, 2025
679edeb
Update temporary_patches.py
danielhanchen Mar 18, 2025
5fd25ec
Update temporary_patches.py
danielhanchen Mar 18, 2025
a884b3c
Update temporary_patches.py
danielhanchen Mar 18, 2025
b6ab8bd
Update temporary_patches.py
danielhanchen Mar 18, 2025
cc3ca48
Update temporary_patches.py
danielhanchen Mar 18, 2025
9f5b67d
Update temporary_patches.py
danielhanchen Mar 18, 2025
e4980b2
Update temporary_patches.py
danielhanchen Mar 18, 2025
d745fb7
Update temporary_patches.py
danielhanchen Mar 18, 2025
201c1ab
Merge branch 'main' into nightly
danielhanchen Mar 18, 2025
2fb83f0
Update compiler.py
danielhanchen Mar 18, 2025
3551715
Update vllm_lora_worker_manager.py
danielhanchen Mar 19, 2025
ab47b77
Update utils.py
danielhanchen Mar 19, 2025
ceed6ab
Update temporary_patches.py
danielhanchen Mar 19, 2025
b5611c2
Update temporary_patches.py
danielhanchen Mar 19, 2025
480aaf7
Update temporary_patches.py
danielhanchen Mar 19, 2025
637c7ad
Update temporary_patches.py
danielhanchen Mar 19, 2025
5a224bb
Update temporary_patches.py
danielhanchen Mar 19, 2025
2248156
Update temporary_patches.py
danielhanchen Mar 19, 2025
ee6ed2b
Update temporary_patches.py
danielhanchen Mar 19, 2025
6d10b9b
Update temporary_patches.py
danielhanchen Mar 19, 2025
9d431b0
Update temporary_patches.py
danielhanchen Mar 19, 2025
42491ca
Update temporary_patches.py
danielhanchen Mar 19, 2025
d3ddadf
Update vllm_utils.py
danielhanchen Mar 19, 2025
dbc6a43
Update vllm_utils.py
danielhanchen Mar 19, 2025
0c4b0d2
Update vllm_utils.py
danielhanchen Mar 19, 2025
5504033
Update vllm_utils.py
danielhanchen Mar 19, 2025
2a84e79
Update dataset_utils.py
danielhanchen Mar 19, 2025
cbbc4a3
bidirectional attention
danielhanchen Mar 19, 2025
3bf532d
Update vllm_utils.py
danielhanchen Mar 19, 2025
8e687b5
Update __init__.py
danielhanchen Mar 19, 2025
a723520
Update temporary_patches.py
danielhanchen Mar 19, 2025
9d1dd42
Update temporary_patches.py
danielhanchen Mar 19, 2025
aec2701
Update temporary_patches.py
danielhanchen Mar 19, 2025
23a3a59
Update vllm_utils.py
danielhanchen Mar 19, 2025
2874477
Update vllm_utils.py
danielhanchen Mar 19, 2025
7d40491
Update vllm_utils.py
danielhanchen Mar 19, 2025
2275642
Update vllm_utils.py
danielhanchen Mar 19, 2025
9cd348f
Update vllm_utils.py
danielhanchen Mar 19, 2025
6e33fa9
Update vllm_utils.py
danielhanchen Mar 19, 2025
7ad0f55
Update vllm_lora_worker_manager.py
danielhanchen Mar 19, 2025
7fd23a0
Update vllm_lora_worker_manager.py
danielhanchen Mar 19, 2025
9176758
Update vllm_lora_worker_manager.py
danielhanchen Mar 19, 2025
b5a38b0
Merge branch 'main' into nightly
danielhanchen Mar 19, 2025
446787d
Merge branch 'main' into nightly
danielhanchen Mar 19, 2025
d2bdd9b
Update temporary_patches.py
danielhanchen Mar 19, 2025
83bde7d
Update temporary_patches.py
danielhanchen Mar 19, 2025
0fe9eaa
Update temporary_patches.py
danielhanchen Mar 19, 2025
3d70a80
Update temporary_patches.py
danielhanchen Mar 19, 2025
6b6587d
Merge branch 'main' into nightly
danielhanchen Mar 21, 2025
88301c5
Update loss_utils.py
danielhanchen Mar 21, 2025
debc0e8
Update loss_utils.py
danielhanchen Mar 21, 2025
7dc2e9d
Update loss_utils.py
danielhanchen Mar 21, 2025
57b4973
Update loss_utils.py
danielhanchen Mar 21, 2025
3cfa271
Update loss_utils.py
danielhanchen Mar 21, 2025
1f5b6f2
Update __init__.py
danielhanchen Mar 21, 2025
2f3c87b
fix: AsyncLLMEngine bugs (#82)
bradhilton Mar 22, 2025
64dd76c
fixed a typo in L119, removing unnecessary len() (#84)
SpaceHunterInf Mar 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion unsloth_zoo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

__version__ = "2025.3.15"
__version__ = "2025.3.16"

from importlib.util import find_spec
if find_spec("unsloth") is None:
Expand Down
16 changes: 4 additions & 12 deletions unsloth_zoo/loss_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,11 @@ def _unsloth_get_batch_samples(self, epoch_iterator, num_batches, device = None,
[((x["labels"][..., 1:] != -100) & (x["attention_mask"][..., 1:] != 0))\
.sum() for x in batch_samples]
)
if device is None: # transformers < 4.50.0 path
if self.args.average_tokens_across_devices:
num_items_in_batch = self.accelerator.gather(num_items_in_batch).sum().item()
if torch.is_tensor(num_items_in_batch):
num_items_in_batch = num_items_in_batch.item()
pass
else: # transformers >= 4.50.0 path
if self.args.average_tokens_across_devices:
num_items_in_batch = self.accelerator.gather(num_items_in_batch).sum()
if torch.is_tensor(num_items_in_batch):
num_items_in_batch = num_items_in_batch.to(device)
pass

if self.args.average_tokens_across_devices:
num_items_in_batch = self.accelerator.gather(num_items_in_batch).sum()
if device is not None and torch.is_tensor(num_items_in_batch):
num_items_in_batch = num_items_in_batch.to(device)
except Exception as exception:
raise RuntimeError(exception)
pass
Expand Down
8 changes: 4 additions & 4 deletions unsloth_zoo/vllm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def get_vllm_state_dict(llm, return_state_dict = False, config = None):
# All Unsloth Zoo code licensed under LGPLv3
# Unmerges vLLM modules and returns HF equivalent state_dict
try:
llm_engine = getattr(llm, "llm_engine", llm)
llm_engine = getattr(llm, "llm_engine", getattr(llm, "engine", llm))
vllm_internals = llm_engine.model_executor.driver_worker.model_runner.model
except:
raise RuntimeError("Unsloth: Failed to access llm.llm_engine.model_executor.driver_worker.model_runner.model")
Expand Down Expand Up @@ -919,7 +919,7 @@ def load_vllm(
# os.environ["VLLM_USE_V1"] = "1"
# pass

from vllm import LLM, LLMEngine, AsyncLLMEngine, EngineArgs
from vllm import LLM, LLMEngine, AsyncLLMEngine, EngineArgs, AsyncEngineArgs

# Default vLLM max_num_seqs is 256
approx_max_num_seqs = 256
Expand Down Expand Up @@ -1007,7 +1007,7 @@ def load_vllm(
swap_space = swap_space, # Low memory devices like Colab (13GB) default 4GB
device = device,
)
good_keys = inspect.signature(EngineArgs).parameters.keys()
good_keys = inspect.signature(AsyncEngineArgs if use_async else EngineArgs).parameters.keys()
old_keys = engine_args.keys()
for key in old_keys:
if key not in good_keys:
Expand All @@ -1021,7 +1021,7 @@ def load_vllm(
while True:
try:
if use_async:
llm = AsyncLLMEngine.from_engine_args(EngineArgs(**engine_args))
llm = AsyncLLMEngine.from_engine_args(AsyncEngineArgs(**engine_args))
elif use_engine:
llm = LLMEngine.from_engine_args(EngineArgs(**engine_args))
else:
Expand Down