Slightly improve the sampler to skip unnecessary steps (#6956)

This commit is contained in:
Lianmin Zheng
2025-06-08 03:18:54 -07:00
committed by GitHub
parent 6c0a48282a
commit 608668e143
7 changed files with 109 additions and 93 deletions
+9 -7
View File
@@ -1928,16 +1928,18 @@ def next_power_of_2(n: int):
setattr(triton, "next_power_of_2", next_power_of_2)
@contextmanager
def empty_context(*args, **kwargs):
try:
# Setup code goes here
yield
finally:
# Cleanup code goes here
class EmptyContextManager:
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
pass
def empty_context(*args, **kwargs):
return EmptyContextManager()
def add_prefix(name: str, prefix: str) -> str:
"""Add a weight path prefix to a module name.