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
    // returned).

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: 9

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: wkentaro/labelme
Commit Name: 448bd4a78699766aea66231ba442b8b5826d2a05
Time: 2019-05-15
Author: www.kentaro.wada@gmail.com
File Name: labelme/widgets/label_dialog.py
Class Name: LabelDialog
Method Name: resetFlags


Project Name: wkentaro/labelme
Commit Name: 448bd4a78699766aea66231ba442b8b5826d2a05
Time: 2019-05-15
Author: www.kentaro.wada@gmail.com
File Name: labelme/app.py
Class Name: MainWindow
Method Name: loadLabels


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