Skip to content

Commit

Permalink
[XLA:MSA] Adding two debugging functions for memory space assignment …
Browse files Browse the repository at this point in the history
…to facilitate reproduction of production bugs in small tests through steering decisions at two key points in the MSA pass flow, before and after AllocateSegment() call:

1) debugging_allocation_request_modifier_fn(): allows modification of AllocationRequest before AllocateSegment(AllocationRequest) calls.

2) debugging_allocation_result_modifier_fn(): enables enforcing arbitrary failures on allocation requests, modifying the output of AllocateSegment(AllocationRequest) calls.

PiperOrigin-RevId: 695826893
  • Loading branch information
mehrdadkhani authored and Google-ML-Automation committed Nov 15, 2024
1 parent 58b5afb commit 6ed0ac5
Show file tree
Hide file tree
Showing 6 changed files with 568 additions and 392 deletions.
16 changes: 15 additions & 1 deletion xla/service/memory_space_assignment/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ xla_cc_test(
deps = [
":algorithm",
":allocation",
":allocation_value",
":buffer_interval_comparator",
":cost_analysis",
":memory_space_assignment",
Expand Down Expand Up @@ -107,7 +108,6 @@ xla_cc_test(
"//xla/service/heap_simulator:allocation_block",
"//xla/tests:hlo_test_base",
"//xla/tests:test_utils",
"//xla/tests:verified_hlo_module",
"//xla/tests:xla_internal_test_main",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/algorithm:container",
Expand Down Expand Up @@ -273,6 +273,7 @@ cc_library(
srcs = [],
hdrs = ["options.h"],
deps = [
":allocation_value",
":buffer_interval_comparator",
":cost_analysis",
":memory_space_assignment_proto_cc",
Expand Down Expand Up @@ -508,6 +509,7 @@ cc_library(
hdrs = ["algorithm.h"],
deps = [
":allocation",
":allocation_value",
":buffer_interval_comparator",
":cost_analysis",
":memory_bound_loop_optimizer",
Expand Down Expand Up @@ -577,6 +579,18 @@ cc_library(
],
)

cc_library(
name = "allocation_value",
hdrs = ["allocation_value.h"],
deps = [
":allocation",
"//xla/hlo/ir:hlo",
"//xla/service:hlo_value",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/types:span",
],
)

xla_cc_test(
name = "prefetch_interval_picker_test",
srcs = ["prefetch_interval_picker_test.cc"],
Expand Down
Loading

0 comments on commit 6ed0ac5

Please sign in to comment.