diff --git a/python/ray/ray_constants.py b/python/ray/ray_constants.py index 50d4b5036..db0dd48b6 100644 --- a/python/ray/ray_constants.py +++ b/python/ray/ray_constants.py @@ -54,7 +54,7 @@ PICKLE_OBJECT_WARNING_SIZE = 10**7 # The maximum resource quantity that is allowed. TODO(rkn): This could be # relaxed, but the current implementation of the node manager will be slower # for large resource quantities due to bookkeeping of specific resource IDs. -MAX_RESOURCE_QUANTITY = 20000 +MAX_RESOURCE_QUANTITY = 40000 # Each memory "resource" counts as this many bytes of memory. MEMORY_RESOURCE_UNIT_BYTES = 50 * 1024 * 1024 diff --git a/python/ray/resource_spec.py b/python/ray/resource_spec.py index 678911dd8..5fe4bb6fd 100644 --- a/python/ray/resource_spec.py +++ b/python/ray/resource_spec.py @@ -104,21 +104,24 @@ class ResourceSpec( } # Check types. - for _, resource_quantity in resources.items(): + for resource_label, resource_quantity in resources.items(): assert (isinstance(resource_quantity, int) or isinstance(resource_quantity, float)) if (isinstance(resource_quantity, float) and not resource_quantity.is_integer()): raise ValueError( "Resource quantities must all be whole numbers. " - "Received {}.".format(resources)) + "Violated by resource '{}' in {}.".format( + resource_label, resources)) if resource_quantity < 0: raise ValueError("Resource quantities must be nonnegative. " - "Received {}.".format(resources)) + "Violated by resource '{}' in {}.".format( + resource_label, resources)) if resource_quantity > ray_constants.MAX_RESOURCE_QUANTITY: - raise ValueError( - "Resource quantities must be at most {}.".format( - ray_constants.MAX_RESOURCE_QUANTITY)) + raise ValueError("Resource quantities must be at most {}. " + "Violated by resource '{}' in {}.".format( + ray_constants.MAX_RESOURCE_QUANTITY, + resource_label, resources)) return resources