MCPcopy
hub / github.com/modelscope/ms-swift / assert_gpu_not_overlap

Method assert_gpu_not_overlap

scripts/benchmark/exp_utils.py:97–103  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

95 self.exps = []
96
97 def assert_gpu_not_overlap(self):
98 all_gpus = set()
99 for exp in self.exps:
100 gpus = exp.runtime['env']['CUDA_VISIBLE_DEVICES'].split(',')
101 if all_gpus & set(gpus):
102 raise ValueError(f'GPU overlap: {self.exps}!')
103 all_gpus.update(gpus)
104
105 def run(self, exp: Experiment):
106 if os.path.exists(os.path.join(exp.input_args.save_dir, exp.name + '.json')):

Callers 1

runMethod · 0.95

Calls 2

splitMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected