()
| 42 | |
| 43 | @pytest.fixture(autouse=True) |
| 44 | def run_around_tests(): |
| 45 | env_vars1 = { |
| 46 | "symbolic_shape": trace_option.use_symbolic_shape(), |
| 47 | "async_level": get_option("async_level"), |
| 48 | "enable_drop": get_option("enable_drop"), |
| 49 | "max_recompute_time": get_option("max_recompute_time"), |
| 50 | "catch_worker_execption": get_option("catch_worker_execption"), |
| 51 | "enable_host_compute": get_option("enable_host_compute"), |
| 52 | # "record_computing_path": get_option("record_computing_path"), |
| 53 | "disable_memory_forwarding": get_option("disable_memory_forwarding"), |
| 54 | "enable_dtr_auto_drop": get_option("enable_dtr_auto_drop"), |
| 55 | "enable_dtr_sqrt_sampling": get_option("enable_dtr_sqrt_sampling"), |
| 56 | "dtr_eviction_threshold": get_option("dtr_eviction_threshold"), |
| 57 | "dtr_evictee_minimum_size": get_option("dtr_evictee_minimum_size"), |
| 58 | "benchmark_kernel": config.benchmark_kernel, |
| 59 | "deterministic_kernel": config.deterministic_kernel, |
| 60 | "compute_mode": config._compute_mode, |
| 61 | "amp_enabled": amp.enabled, |
| 62 | "convert_inputs": _get_convert_inputs(), |
| 63 | "amp_dtype_autocast": _get_amp_dtype_autocast(), |
| 64 | "amp_high_prec_dtype": _get_amp_high_prec_dtype(), |
| 65 | "amp_low_prec_dtype": _get_amp_low_prec_dtype(), |
| 66 | } |
| 67 | yield |
| 68 | env_vars2 = { |
| 69 | "symbolic_shape": trace_option.use_symbolic_shape(), |
| 70 | "async_level": get_option("async_level"), |
| 71 | "enable_drop": get_option("enable_drop"), |
| 72 | "max_recompute_time": get_option("max_recompute_time"), |
| 73 | "catch_worker_execption": get_option("catch_worker_execption"), |
| 74 | "enable_host_compute": get_option("enable_host_compute"), |
| 75 | # "record_computing_path": get_option("record_computing_path"), |
| 76 | "disable_memory_forwarding": get_option("disable_memory_forwarding"), |
| 77 | "enable_dtr_auto_drop": get_option("enable_dtr_auto_drop"), |
| 78 | "enable_dtr_sqrt_sampling": get_option("enable_dtr_sqrt_sampling"), |
| 79 | "dtr_eviction_threshold": get_option("dtr_eviction_threshold"), |
| 80 | "dtr_evictee_minimum_size": get_option("dtr_evictee_minimum_size"), |
| 81 | "benchmark_kernel": config.benchmark_kernel, |
| 82 | "deterministic_kernel": config.deterministic_kernel, |
| 83 | "compute_mode": config._compute_mode, |
| 84 | "amp_enabled": amp.enabled, |
| 85 | "convert_inputs": _get_convert_inputs(), |
| 86 | "amp_dtype_autocast": _get_amp_dtype_autocast(), |
| 87 | "amp_high_prec_dtype": _get_amp_high_prec_dtype(), |
| 88 | "amp_low_prec_dtype": _get_amp_low_prec_dtype(), |
| 89 | } |
| 90 | for key in env_vars1: |
| 91 | assert ( |
| 92 | env_vars1[key] == env_vars2[key] |
| 93 | ), "{} have been changed after test".format(key) |
nothing calls this directly
no test coverage detected