search: add a BEAM_COMPARE env to optionally not compare to hc/tc (#4107)

* search: add a BEAM_COMPARE env to optionally not compare to hc/tc

setting BEAM_COMPARE=0 will prevent additional memory allocation
needed to do the timing tests assuming the BEAM result is in
the diskcache.

* change to optionally use Buffer.allocate
This commit is contained in:
Francis Lam
2024-04-08 15:54:01 -07:00
committed by GitHub
parent c390828f61
commit 46850a0269
3 changed files with 25 additions and 19 deletions

View File

@@ -23,8 +23,8 @@ if __name__ == '__main__':
with open(args.file, 'r') as file:
ast_strs = file.readlines()
for ast_str in ast_strs:
print(f"optimizing ast={ast_str}")
for i, ast_str in enumerate(ast_strs):
print(f"optimizing {i}/{len(ast_strs)}\nast={ast_str}")
lin = ast_str_to_lin(ast_str, opts=device.compiler.compiler_opts)
rawbufs = bufs_from_lin(lin)
lin = beam_search(lin, rawbufs, getenv("BEAM", 8), bool(getenv("BEAM_ESTIMATE", 1)))