mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 11:05:26 +08:00
Revert "Updating zero capacity resource semantics (#4555)"
This reverts commit 0f42f87ebc.
This commit is contained in:
@@ -32,6 +32,7 @@ import org.ray.runtime.raylet.RayletClient;
|
||||
import org.ray.runtime.task.ArgumentsBuilder;
|
||||
import org.ray.runtime.task.TaskLanguage;
|
||||
import org.ray.runtime.task.TaskSpec;
|
||||
import org.ray.runtime.util.ResourceUtil;
|
||||
import org.ray.runtime.util.UniqueIdUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -356,6 +357,11 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
||||
resources = new HashMap<>(taskOptions.resources);
|
||||
}
|
||||
|
||||
if (!resources.containsKey(ResourceUtil.CPU_LITERAL)
|
||||
&& !resources.containsKey(ResourceUtil.CPU_LITERAL.toLowerCase())) {
|
||||
resources.put(ResourceUtil.CPU_LITERAL, 0.0);
|
||||
}
|
||||
|
||||
int maxActorReconstruction = 0;
|
||||
if (taskOptions instanceof ActorCreationOptions) {
|
||||
maxActorReconstruction = ((ActorCreationOptions) taskOptions).maxReconstructions;
|
||||
|
||||
@@ -104,6 +104,10 @@ public class RayConfig {
|
||||
+ "setting it to the number of CPU cores: {}", numCpu);
|
||||
resources.put("CPU", numCpu * 1.0);
|
||||
}
|
||||
if (!resources.containsKey("GPU")) {
|
||||
LOGGER.warn("No GPU resource is set in configuration, setting it to 0");
|
||||
resources.put("GPU", 0.0);
|
||||
}
|
||||
}
|
||||
// Driver id.
|
||||
String driverId = config.getString("ray.driver.id");
|
||||
|
||||
Reference in New Issue
Block a user