Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
5 changes: 2 additions & 3 deletions .github/run-benchmark-as-lit-jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ def main(gh_run_id: str = ""):
print("Uploading package and benchmark script...")
s.upload_folder("dist", remote_path="dist")
pkg_path = glob.glob("dist/*.whl")[0]
s.upload_file("examples/coverage/requirements.txt", remote_path="benchmarks/requirements.txt")
s.upload_file("thunder/benchmarks/benchmark_hf.py", remote_path="benchmarks/benchmark_hf.py")

print("Starting studio...")
s.start()
print("Installing Thunder and dependencies...")
s.run(
f"pip install {pkg_path} -U transformers==4.52.4 nvidia-cudnn-frontend 'numpy<2.0' 'nvfuser_cu128_torch27==0.2.27.dev20250615'"
)
s.run(f"pip install {pkg_path} -U -r benchmarks/requirements.txt")

print("Running HF benchmark script...")
job = Job.run(
Expand Down
2 changes: 1 addition & 1 deletion examples/coverage/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
transformers==4.52.4
transformers==4.55.4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This degrades the coverage in the coverage testing (but feel free to do your own requirements.txt if it helps)

accelerate
nvfuser-cu128-torch28
nvidia-cudnn-frontend
Expand Down
13 changes: 3 additions & 10 deletions thunder/benchmarks/benchmark_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@

import thunder
from thunder.dev_utils.benchmark import benchmark_n
from thunder.recipes.base import BaseRecipe
from thunder.recipes.hf_transformers import HFTransformers

from torch.profiler import profile, record_function, ProfilerActivity


class DebugRecipe(BaseRecipe):
def setup_config(self):
config = super().setup_config()
return config


device = "cuda"
model_name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"

Expand All @@ -28,8 +21,8 @@ def setup_config(self):
plugins_str = "" if plugins is None else plugins if isinstance(plugins, str) else "-".join(plugins)

# Define recipes
nvfuser_recipe = DebugRecipe()
torchcompile_recipe = DebugRecipe(fuser="torch.compile")
nvfuser_recipe = HFTransformers()
torchcompile_recipe = HFTransformers(fuser="torch.compile")
recipes = [nvfuser_recipe, torchcompile_recipe]


Expand Down
4 changes: 3 additions & 1 deletion thunder/recipes/hf_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,19 @@ class HFTransformers(BaseRecipe):

Args:
show_progress (bool, optional): Forwarded to :class:`BaseRecipe`.
fuser (str, optional): which fuser to use, default NvFuser.
interpreter (str, optional): Thunder interpreter to use.
plugins (Iterable | None, optional): Extra Thunder plugins.
"""

def __init__(
self,
show_progress=False,
fuser="nvfuser",
interpreter="thunder.jit",
plugins=None,
):
super().__init__(show_progress=show_progress, interpreter=interpreter, plugins=plugins)
super().__init__(show_progress=show_progress, fuser=fuser, interpreter=interpreter, plugins=plugins)

# for kv-cache inplace ops
self.inplace_index_copy_transform = InplaceIndexCopyTransform()
Expand Down
Loading