Use regexp for gpu_spec model matching, supporting both positive and exclusion patterns#677
Conversation
Allow tasks to exclude a specific GPU model using != in the gpu_spec model field of the JSON architecture string (e.g. !=Tesla P100-SXM2-16GB). Previously only positive model matching was supported from the task side.
|
One more review @tmaeno to implement Johannes's wildcard use as in "!=P100" |
|
How about allowing regexp to specify the model? You wouldn't need separate code paths |
|
Much cleaner with your suggestion, working on it - thank you! |
…exclusion patterns
|
@tmaeno please have a look at this new implementation based on your suggestion |
tmaeno
left a comment
There was a problem hiding this comment.
Actually, I started thinking we need to introduce a separate entry in the gpu_spec for exclusion. The current code does not exclude the PQ when an item in the list passes the antimatch pattern. One possibility would be to add "excl": True, and then the logic could be something like
is_match = any(re.match(host_gpu_spec["model"], m) for m in architecture_map["gpu"]["model"])
if is_match == host_gpu_spec.get("excl", False):
continue
{"model": "^.*P100.*", "excl": true} will exclude PQs with P100, while {"model": "^(?!.*P100).*$"} will include PQs if some model names don't contain P100.
|
Thank you Tadashi, I will have a look tomorrow morning.
On Mar 12, 2026 18:23, Tadashi Maeno ***@***.***> wrote:
@tmaeno commented on this pull request.
Actually, I started thinking we need to introduce a separate entry in the gpu_spec for exclusion. The current code does not exclude the PQ when an item in the list passes the antimatch pattern. One possibility would be to add "excl": True, and then the logic could be something like
is_match = any(re.match(host_gpu_spec["model"], m) for m in architecture_map["gpu"]["model"])
if is_match == host_gpu_spec.get("excl", False):
continue
{"model": "^.*P100.*", "excl": true} will exclude PQs with P100, while {"model": "^(?!.*P100).*$"} will include PQs if some model names don't contain P100.
—
Reply to this email directly, view it on GitHub<#677 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACI3SY2ZUKOAHZOAYOHUVE34QLXABAVCNFSM6AAAAACWPWHN52VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTSMZYGM4TSNBXGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Summary
gpu_specmodel!=exclusion patternfnmatchso both exact names and glob patterns work (e.g.,!=Tesla P100-SXM2-16GBor!=*P100*)Change