MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / find_and_process_ttgir

Function find_and_process_ttgir

benchmarking/insert_proton_records.py:226–254  ·  view source on GitHub ↗

Find all FMMS kernel TTGIR files in the dump directory and process them.

(dump_dir: str)

Source from the content-addressed store, hash-verified

224
225
226def find_and_process_ttgir(dump_dir: str) -> None:
227 """Find all FMMS kernel TTGIR files in the dump directory and process them."""
228 if not os.path.isdir(dump_dir):
229 print(f"Error: directory not found: {dump_dir}", file=sys.stderr)
230 sys.exit(1)
231
232 ttgir_files = glob.glob(os.path.join(dump_dir, "**", "*.ttgir"), recursive=True)
233 if not ttgir_files:
234 print(f"No .ttgir files found in {dump_dir}", file=sys.stderr)
235 sys.exit(1)
236
237 fmms_files = [f for f in ttgir_files if "fused_mm_sample" in os.path.basename(f)]
238 if not fmms_files:
239 print(
240 f"No fused_mm_sample*.ttgir files found in {dump_dir}. "
241 f"Found: {[os.path.basename(f) for f in ttgir_files]}",
242 file=sys.stderr,
243 )
244 sys.exit(1)
245
246 for ttgir_file in fmms_files:
247 try:
248 print(f"Processing {ttgir_file}...")
249 add_proton_records(ttgir_file)
250 except AssertionError as e:
251 print(f"Skipping {ttgir_file}: {e}")
252 except Exception as e:
253 print(f"Error processing {ttgir_file}: {e}")
254 raise
255
256
257if __name__ == "__main__":

Callers 1

Calls 1

add_proton_recordsFunction · 0.85

Tested by

no test coverage detected