Skip to content

Problems about new scheduler #9466

@kisuke95

Description

@kisuke95

What is the problem?

Ray version and other system information (Python version, TensorFlow version, OS):

There are several problems about new scheduler used in raylet.

In the following code (just copy from master), in the first for statement, we do this (*allocation)[i] = 1.; available[i] = 0;, but int the second for statement, we may clear it with (*allocation)[i] = available[i]; (because available[i] maybe set 0 in the first for statement)

if (remaining_demand >= 1.) {
  for (size_t i = 0; i < available.size(); i++) {
    if (available[i] == 1.) {
      // Allocate a full unit-capacity instance.
      (*allocation)[i] = 1.;
      available[i] = 0;
      remaining_demand -= 1.;
    }
    if (remaining_demand < 1.) {
      break;
    }
  }
}

if (soft) {
  // Just get as many resources as available.
  for (size_t i = 0; i < available.size(); i++) {
    if (available[i] >= remaining_demand) {
      available[i] -= remaining_demand;
      (*allocation)[i] = remaining_demand;
      return true;
    } else {
      (*allocation)[i] = available[i];
      remaining_demand -= available[i];
      available[i] = 0;
    }
  }
  return true;
}

Reproduction (REQUIRED)

Please provide a script that can be run to reproduce the issue. The script should have no external library dependencies (i.e., use fake or mock data / environments):

If we cannot run your script, we cannot fix your issue.

  • I have verified my script runs in a clean environment and reproduces the issue.
  • I have verified the issue also occurs with the latest wheels.

Metadata

Metadata

Labels

bugSomething that is supposed to be working; but isn't

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions