Merge branch 'main' into nightly

This commit is contained in:
Daniel Han 2025-05-14 20:30:41 -07:00
commit 49c4bf1471
4 changed files with 13 additions and 11 deletions

View file

@ -37,7 +37,7 @@ triton = [
]
huggingface = [
"unsloth_zoo>=2025.5.1",
"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.1",
"unsloth_zoo>=2025.5.5",
"packaging",
"tyro",
"transformers==4.51.3,!=4.47.0",

View file

@ -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,
@ -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
@ -192,12 +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()
llm = Dummy2().llm.llm_engine.model_executor
delete_vllm(llm)
delete_vllm(llm = None)
pass
def __enter__(self): return self

View file

@ -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.3"
__all__ = [
"SUPPORTS_BFLOAT16",

View file

@ -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