mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-07 03:00:26 -04:00
use unittest helpers in TestTensorMetadata [pr] (#7329)
* use unittest helpers in TestTensorMetadata [pr] * fix that * 5 args
This commit is contained in:
4
test/external/process_replay/helpers.py
vendored
4
test/external/process_replay/helpers.py
vendored
@@ -8,10 +8,10 @@ class ProcessReplayContext:
|
||||
loc: str
|
||||
head_sha: str
|
||||
run_id: Optional[int]
|
||||
def get_process_replay_ctx() -> Tuple[Dict, ProcessReplayContext]:
|
||||
def get_process_replay_ctx() -> Tuple[ProcessReplayContext, Dict]:
|
||||
stack = filter(lambda x: "tinygrad" in x.filename and not any(n in x.filename for n in ["engine/schedule.py", "engine/realize.py", \
|
||||
"codegen/kernel.py", "unittest"]), traceback.extract_stack()[:-1])
|
||||
loc = "\n".join(traceback.format_list(stack))
|
||||
try: head_sha = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode()
|
||||
except Exception: head_sha = ""
|
||||
return {k:v.value for k,v in ContextVar._cache.items()}, ProcessReplayContext(loc, head_sha, getenv("GITHUB_RUN_ID") or None)
|
||||
return ProcessReplayContext(loc, head_sha, getenv("GITHUB_RUN_ID") or None), {k:v.value for k,v in ContextVar._cache.items()}
|
||||
|
||||
@@ -29,7 +29,7 @@ if REF == "master": SKIP_PROCESS_REPLAY = True
|
||||
# *** recreators
|
||||
|
||||
def recreate_sched(sink:UOp, ctx:ScheduleItemContext) -> UOp: return full_ast_rewrite(sink, ctx)
|
||||
def recreate_kernel(ast:UOp, opts:Renderer, applied_opts:List[Opt], name:str) -> str:
|
||||
def recreate_kernel(ast:UOp, opts:Renderer, applied_opts:List[Opt], name:str, _) -> str:
|
||||
k = Kernel(ast, opts=opts)
|
||||
for opt in applied_opts: k.apply_opt(opt)
|
||||
# NOTE: replay with the captured renderer, not the one in master
|
||||
|
||||
Reference in New Issue
Block a user