Skip to content

[data] Fix bug in memory reservation - #43511

Merged
can-anyscale merged 13 commits into
ray-project:masterfrom
raulchen:fix-memory-reservation
Feb 29, 2024
Merged

can-anyscale merged 13 commits into
ray-project:masterfrom
raulchen:fix-memory-reservation

Conversation

@raulchen

@raulchen raulchen commented Feb 28, 2024 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Fix bugs in ReservationOpResourceAllocator (introduced by #43171)

  • We treat a map op and its following non-map ops as the same group. update_resources already handles this properly . But _should_unblock_streaming_output_backpressure and _op_outputs_reserved_remaining didn't consider this.
  • Since we don't reserve any resources for limit and streaming_split, should set num_cpus=0 for their tasks.
  • _reserved_for_op_outputs currently also includes op's internal output buffers. This is incorrect, because when preserve_order=True, task outputs will accumulate in op's internal output buffer, and use all the memory budget from _reserved_for_op_outputs. Then we still don't have memory budget to pull the blocks from the internal output buffer. Excluding the internal output buffer from _reserved_for_op_outputs fixes this issue.

Also deflake test_backpressure_from_output and test_e2e_autoscaling_up, as they depend on physical memory size of the node.

Related issue number

closes #43493
closes #43490

Checks

Signed-off-by: Hao Chen <[email protected]>
Signed-off-by: Hao Chen <[email protected]>

@c21 c21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG


E.g.,
- "cur_map->downstream_map" will return [downstream_map].
- "cur_map->limit1->limi2->downstream_map" will return [downstream_map].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

limi2 typo

Comment on lines 121 to 131
@pytest.mark.parametrize(
"cluster_cpus, cluster_obj_store_mem_mb",
"cluster_cpus, cluster_obj_store_mem_mb, insert_limit_op",
[
(3, 500), # CPU not enough
(4, 100), # Object store memory not enough
(3, 100), # Both not enough
(3, 500, False), # CPU not enough
(3, 500, True), # CPU not enough
(4, 100, False), # Object store memory not enough
(4, 100, True), # Object store memory not enough
(3, 100, False), # Both not enough
(3, 100, True), # Both not enough
],
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: To test all existing combinations with insert_limit_op, it might be cleaner to do another parametrize:

@pytest.mark.parametrize(
    "cluster_cpus", "cluster_obj_store_mem_mb",
    [
        (3, 500),
        (4, 100),
        (3, 100),
    ]
)
@pytest.mark.parametrize("insert_limit_op", [False, True])

@can-anyscale

Copy link
Copy Markdown
Contributor

Can you help check that the failing tests on premerge are same as ones failing. in go/flaky. Thankks

@raulchen

Copy link
Copy Markdown
Contributor Author

@can-anyscale checked. one is an existing flaky test, the other is because hugging face is down now.

@can-anyscale
can-anyscale merged commit c61bbc0 into ray-project:master Feb 29, 2024
@raulchen
raulchen deleted the fix-memory-reservation branch February 29, 2024 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release test iter_tensor_batches_benchmark_multi_node.aws failed Release test read_images_train_16_gpu_preserve_order.aws failed

4 participants