From 80daf6bb8359ae7ac93992e0d0b8876e8e8acf0d Mon Sep 17 00:00:00 2001 From: Mathew Mathew Date: Fri, 9 May 2025 16:50:16 -0500 Subject: [PATCH 1/9] turn off compilation and fast generation for csm --- unsloth/models/loader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index 7e904471bc..f0eab18a72 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -540,6 +540,9 @@ class FastModel(FastBaseModel): os.environ["UNSLOTH_COMPILE_DISABLE"] = "1" if transformers_version < Version("4.50.0.dev0"): raise RuntimeError("Unsloth: Granite Vision only works on transformers >= 4.50.0." + NIGHTLY) + elif "csm-1b" in model_name.lower(): + os.environ["UNSLOTH_COMPILE_DISABLE"] = "1" + os.environ["UNSLOTH_DISABLE_FAST_GENERATION"] = "1" elif "olmo-2" in model_name.lower() and transformers_version < Version("4.50.0.dev0"): raise RuntimeError("Unsloth: OLMo-2 only works on transformers >= 4.50.0." + NIGHTLY) pass From 77ebc7b74e9de8a8bc5d18c0840b707b8e1aa96b Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 13 May 2025 09:10:24 -0700 Subject: [PATCH 2/9] Versioning --- pyproject.toml | 4 ++-- unsloth/models/_utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d37b0bfd22..7f049d6f21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ triton = [ ] huggingface = [ - "unsloth_zoo>=2025.5.1", + "unsloth_zoo>=2025.5.2", "packaging", "tyro", "transformers==4.51.3,!=4.47.0", @@ -381,7 +381,7 @@ colab-ampere-torch220 = [ "flash-attn>=2.6.3", ] colab-new = [ - "unsloth_zoo>=2025.5.1", + "unsloth_zoo>=2025.5.2", "packaging", "tyro", "transformers==4.51.3,!=4.47.0", diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 4b9e2cce06..9ec3f8d2de 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2025.5.1" +__version__ = "2025.5.2" __all__ = [ "SUPPORTS_BFLOAT16", From d6fbd3043e2a0e59fb93997209c79b493405425e Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 14 May 2025 03:44:15 -0700 Subject: [PATCH 3/9] Update synthetic.py --- unsloth/dataprep/synthetic.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unsloth/dataprep/synthetic.py b/unsloth/dataprep/synthetic.py index 32ebad60ba..c9609ca61c 100644 --- a/unsloth/dataprep/synthetic.py +++ b/unsloth/dataprep/synthetic.py @@ -81,6 +81,9 @@ class SyntheticDataKit: if "device" in engine_args: del engine_args["device"] if "model" in engine_args: del engine_args["model"] + if "compilation_config" in engine_args: + # Cannot parse in vllm serve + engine_args["compilation_config"] = 3 subprocess_commands = [ "vllm", "serve", str(model_name), @@ -113,7 +116,8 @@ class SyntheticDataKit: print("Stdout stream ended before readiness message detected.") break output_str = output.decode('utf-8', errors='ignore').strip() - print(f"vLLM STDOUT: {output_str}") + if "platform is" not in output_str: + print(f"vLLM STDOUT: {output_str}") if ready_message_part in output: print(f"\n--- vLLM Server Ready (Detected: '{ready_message_part.decode()}') ---") ready = True From 175c39e9b188cb31ebd4fcbfeb23049b6ee49c60 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 14 May 2025 03:47:29 -0700 Subject: [PATCH 4/9] Update synthetic.py --- unsloth/dataprep/synthetic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/dataprep/synthetic.py b/unsloth/dataprep/synthetic.py index c9609ca61c..f18d5818c2 100644 --- a/unsloth/dataprep/synthetic.py +++ b/unsloth/dataprep/synthetic.py @@ -64,7 +64,7 @@ class SyntheticDataKit: model_name, token = token, ) - patch_vllm() + patch_vllm(debug = False) engine_args = load_vllm( model_name = model_name, config = self.config, From 9dd46b5a6d05625134feecac5c32631bb3f59027 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 14 May 2025 03:49:27 -0700 Subject: [PATCH 5/9] Update synthetic.py --- unsloth/dataprep/synthetic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/dataprep/synthetic.py b/unsloth/dataprep/synthetic.py index f18d5818c2..c549c2d409 100644 --- a/unsloth/dataprep/synthetic.py +++ b/unsloth/dataprep/synthetic.py @@ -200,7 +200,7 @@ class SyntheticDataKit: class Dummy0: model_executor = 1 class Dummy1: llm_engine = Dummy0() class Dummy2: llm = Dummy1() - llm = Dummy2().llm.llm_engine.model_executor + llm = Dummy2() delete_vllm(llm) pass From 62e669b29168b004bece76ec86d7e3d45223f917 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 14 May 2025 03:54:46 -0700 Subject: [PATCH 6/9] Update synthetic.py --- unsloth/dataprep/synthetic.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/unsloth/dataprep/synthetic.py b/unsloth/dataprep/synthetic.py index c549c2d409..91b20bb0e7 100644 --- a/unsloth/dataprep/synthetic.py +++ b/unsloth/dataprep/synthetic.py @@ -200,8 +200,7 @@ class SyntheticDataKit: class Dummy0: model_executor = 1 class Dummy1: llm_engine = Dummy0() class Dummy2: llm = Dummy1() - llm = Dummy2() - delete_vllm(llm) + delete_vllm(Dummy2().llm) pass def __enter__(self): return self From 957c203f0edc52ceb4598255d9a0e31309289bab Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 14 May 2025 04:05:23 -0700 Subject: [PATCH 7/9] Update synthetic.py --- unsloth/dataprep/synthetic.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/unsloth/dataprep/synthetic.py b/unsloth/dataprep/synthetic.py index 91b20bb0e7..a29e6626a3 100644 --- a/unsloth/dataprep/synthetic.py +++ b/unsloth/dataprep/synthetic.py @@ -196,11 +196,7 @@ class SyntheticDataKit: gc.collect() # Delete vLLM module as well - # We delete llm.llm_engine.model_executor, so first make it accessible - class Dummy0: model_executor = 1 - class Dummy1: llm_engine = Dummy0() - class Dummy2: llm = Dummy1() - delete_vllm(Dummy2().llm) + delete_vllm(llm = None) pass def __enter__(self): return self From 75cdebf9b7727b5376e668d0110b6e79bd554137 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 14 May 2025 05:42:11 -0700 Subject: [PATCH 8/9] Update _utils.py --- unsloth/models/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 9ec3f8d2de..882de28cba 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2025.5.2" +__version__ = "2025.5.3" __all__ = [ "SUPPORTS_BFLOAT16", From 4170900b47abd227b7e4d8cda0eec62ff2d25619 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 14 May 2025 05:42:47 -0700 Subject: [PATCH 9/9] Update pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7f049d6f21..d438c83d67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ triton = [ ] huggingface = [ - "unsloth_zoo>=2025.5.2", + "unsloth_zoo>=2025.5.5", "packaging", "tyro", "transformers==4.51.3,!=4.47.0", @@ -381,7 +381,7 @@ colab-ampere-torch220 = [ "flash-attn>=2.6.3", ] colab-new = [ - "unsloth_zoo>=2025.5.2", + "unsloth_zoo>=2025.5.5", "packaging", "tyro", "transformers==4.51.3,!=4.47.0",