c9f13b0833ee499a074f15192a6eaf7a6513a296,python/ray/worker.py,,get_gpu_ids,#Any#,376

Before Change


    // TODO(ilr) Handle inserting resources in local mode
    all_resource_ids = global_worker.core_worker.resource_ids()
    assigned_ids = [
        resource_id for resource_id, _ in all_resource_ids.get("GPU", [])
    ]
    // If the user had already set CUDA_VISIBLE_DEVICES, then respect that (in
    // the sense that only GPU IDs that appear in CUDA_VISIBLE_DEVICES should be

After Change


    // TODO(ilr) Handle inserting resources in local mode
    all_resource_ids = global_worker.core_worker.resource_ids()
    assigned_ids = []
    for resource, assignment in all_resource_ids.items():
        // Handle both normal and placement group GPU resources.
        if resource == "GPU" or resource.startswith("GPU_group_"):
            for resource_id, _ in assignment:
                assigned_ids.append(resource_id)
    // If the user had already set CUDA_VISIBLE_DEVICES, then respect that (in
    // the sense that only GPU IDs that appear in CUDA_VISIBLE_DEVICES should be
    // returned).
    if global_worker.original_gpu_ids is not None:
        assigned_ids = [
            global_worker.original_gpu_ids[gpu_id] for gpu_id in assigned_ids
        ]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: ray-project/ray
Commit Name: c9f13b0833ee499a074f15192a6eaf7a6513a296
Time: 2020-08-13
Author: ekhliang@gmail.com
File Name: python/ray/worker.py
Class Name:
Method Name: get_gpu_ids


Project Name: NervanaSystems/nlp-architect
Commit Name: c67aabab14b14fdef4b7e0ac576e2178dfb272b3
Time: 2019-03-06
Author: peteriz@users.noreply.github.com
File Name: setup.py
Class Name:
Method Name:


Project Name: NervanaSystems/nlp-architect
Commit Name: f2889ca90ddd60b19070b7e8fbcb0867ae4c47ed
Time: 2019-05-01
Author: peter.izsak@intel.com
File Name: setup.py
Class Name:
Method Name: