-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_alpha.py
43 lines (35 loc) · 1.22 KB
/
config_alpha.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import tvm
from components import profiling
# workload config
repeat = 1024
data_layout = "NCHW"
kernel_layout = "OIHW"
batch_sizes = [1, 16, 32, 64, 128, 256, 512, 1024]
dense_extension = [2,3]
# defining important variables for the profiling system
#target and device config
target = "cuda"
target_class = "cuda"
device = "A100"
dev_idx = 0
dev = tvm.device(str("cuda"), dev_idx)
# profiling metrics
papi_base = "nvml:::NVIDIA_A100-SXM4-40GB:device_"
metrics = []
if device == "A100":
metrics = profiling.get_metrics(target, device, backend="nvml", dev_idx=dev_idx)
metrics.append(papi_base+str(dev_idx)+":gpu_utilization")
metrics.append(papi_base+str(dev_idx)+":memory_utilization")
metrics.append(papi_base+str(dev_idx)+":graphics_clock")
metrics.append(papi_base+str(dev_idx)+":sm_clock")
metrics.append(papi_base+str(dev_idx)+":memory_clock")
metrics.append(papi_base+str(dev_idx)+":allocated_memory")
#builder for data_collector
def get_data_collector(dev, metrics, component="nvml"):
collector = tvm.runtime.profiling.PAPIMetricCollector({dev: metrics}, component=component)
return collector
# sampling resolution
time_min_res = 0.2
### currently unused
state_path = "./states"
state_file = "state"