From c5fa3149378d1dca692c1a56036e6926a9f12cb2 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sat, 14 Mar 2026 05:29:49 +0000 Subject: [PATCH] Revert "adding tools to be able to profile model fwds to see what to turn into kernels" This reverts commit d32b00ecd8fe9120c78386615892230d9470a9f6. --- tests/profiles/profile_phi2.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 tests/profiles/profile_phi2.py diff --git a/tests/profiles/profile_phi2.py b/tests/profiles/profile_phi2.py deleted file mode 100644 index 39708062b7..0000000000 --- a/tests/profiles/profile_phi2.py +++ /dev/null @@ -1,27 +0,0 @@ -import torch -from transformers import AutoModelForCausalLM, AutoTokenizer - -from unsloth.kernels.utils import profile_generate_method - -torch.set_default_device("cuda") - -model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", torch_dtype="auto", trust_remote_code=True) -tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True) - -inputs = tokenizer('''def print_prime(n): - """ - Print all primes between 1 and n - """''', return_tensors="pt", return_attention_mask=False) - - -generate_args = { - **inputs, # Assuming model_inputs is a dictionary with appropriate keys - "max_new_tokens": 100, - "do_sample": True -} - -# Ensure your model and tokenizer are properly loaded and set up as before. - -# Now, call the profile_generate_method function -prof = profile_generate_method(model, generate_args) -