Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile issue for earlier c++ versions #16291

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,15 @@ std::vector<ttnn::ccl::v2::TensorSlice> split_tensor_slice_across_workers_wrappe
return worker_slice;
};

const auto worker_slices_view =
compute_evenly_split_sizes(num_pages, num_workers) |
std::views::transform([to_cmd_tensor](auto size_offset) { return to_cmd_tensor(size_offset); });

const auto evenly_split_sizes = compute_evenly_split_sizes(num_pages, num_workers);
std::vector<ttnn::ccl::v2::TensorSlice> worker_slices;
worker_slices.reserve(num_workers);
std::ranges::copy(worker_slices_view, std::back_inserter(worker_slices));
std::transform(
evenly_split_sizes.begin(),
evenly_split_sizes.end(),
std::back_inserter(worker_slices),
[to_cmd_tensor](auto size_offset) { return to_cmd_tensor(size_offset); });

TT_FATAL(
worker_slices.size() == num_workers, "Expected {} worker slices but got {}", num_workers, worker_slices.size());
return worker_slices;
Expand Down Expand Up @@ -161,11 +163,14 @@ std::vector<ttnn::ccl::v2::TensorSlice> compute_page_aligned_slices(
return cmd_tensor;
};

const auto tensor_slices_view =
compute_evenly_split_sizes(input_tensor_shape_in_tiles[split_dim], num_slices) |
std::views::transform([to_cmd_tensor](auto size_offset) { return to_cmd_tensor(size_offset); });
const auto evenly_split_sizes = compute_evenly_split_sizes(input_tensor_shape_in_tiles[split_dim], num_slices);
tensor_slices.reserve(evenly_split_sizes.size());
std::transform(
evenly_split_sizes.begin(),
evenly_split_sizes.end(),
std::back_inserter(tensor_slices),
[to_cmd_tensor](auto size_offset) { return to_cmd_tensor(size_offset); });

std::ranges::copy(tensor_slices_view, std::back_inserter(tensor_slices));
TT_FATAL(
tensor_slices.size() == num_slices, "Expected {} tensor slices but got {}", num_slices, tensor_slices.size());

Expand Down
Loading