Download workloads/micro/clean_output.py from lrh12580/UvmPinAsync: direct link, hf CLI and curl.
- Browser
- Download file 625 Bytes
-
https://huggingface.co/lrh12580/UvmPinAsync/resolve/main/workloads/micro/clean_output.py
- Command line
-
hf download hf://lrh12580/UvmPinAsync/workloads/micro/clean_output.py
-
curl -L -o clean_output.py https://huggingface.co/lrh12580/UvmPinAsync/resolve/main/workloads/micro/clean_output.py
625 Bytes
| import sys, os | |
| file_name = sys.argv[1] | |
| new_file_name = sys.argv[1] | |
| f_old = open(file_name, "r") | |
| lines = f_old.readlines() | |
| os.remove(file_name) | |
| f_new = open(new_file_name, "w+") | |
| for line in lines: | |
| words = (line.split(',')) | |
| words_space = (line.split(' ')) | |
| if words_space[0] == 'start_tsc': | |
| words = words_space | |
| line = line.replace(' ', ',') | |
| if len(words) < 4: | |
| continue | |
| if words[0] == 'start_tsc' or words[0] == 'CPU_Times' or words[0] == 'pc' or words[0] == 'CUPTI' or "cuda" in words[1]: | |
| # TODO: remove arguments in kernel name | |
| f_new.write(line) | |
| f_new.close() | |