Skip to content

Commit

Permalink
[GR-58270] Hotfix for vm config resolution.
Browse files Browse the repository at this point in the history
PullRequest: mx/1848
  • Loading branch information
farquet committed Nov 4, 2024
2 parents 76b13a9 + 9552f6d commit c814bf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/mx/_impl/mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18215,7 +18215,7 @@ def alarm_handler(signum, frame):
_CACHE_DIR = get_env('MX_CACHE_DIR', join(dot_mx_dir(), 'cache'))

# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
version = VersionSpec("7.34.0") # [GR-58270] Allow syntactic sugar to configure benchmark VM configs
version = VersionSpec("7.34.1") # [GR-58270] lazily check benchmark VM configs

_mx_start_datetime = datetime.utcnow()

Expand Down
13 changes: 7 additions & 6 deletions src/mx/_impl/mx_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,13 @@ def add_vm(self, vm, suite=None, priority=0):
def get_vm(self, vm_name, vm_config):
resolved_name = None
for (candidate_vm_name, candidate_vm_config), candidate_vm in self._vms.items():
canonical_name = candidate_vm.canonical_config_name(vm_config)
if vm_name == candidate_vm_name and canonical_name == candidate_vm_config:
resolved_name = candidate_vm_config
if vm_config != canonical_name:
mx.log(f"Canonicalized the '{vm_config}' vm config to: {resolved_name}")
break
if vm_name == candidate_vm_name:
canonical_name = candidate_vm.canonical_config_name(vm_config)
if canonical_name == candidate_vm_config:
resolved_name = candidate_vm_config
if vm_config != canonical_name:
mx.log(f"Canonicalized the '{vm_config}' vm config to: {resolved_name}")
break
key = (vm_name, resolved_name or vm_config)
if key not in self._vms:
mx.abort(f"{self.vm_type_name} and config '{key}' do not exist.\n{self.get_available_vm_configs_help()}")
Expand Down

0 comments on commit c814bf9

Please sign in to comment.