Meta28 optimization upstream#113
Open
shbiswas834 wants to merge 26 commits intoshbiswas/upstream_0815from
Open
Meta28 optimization upstream#113shbiswas834 wants to merge 26 commits intoshbiswas/upstream_0815from
shbiswas834 wants to merge 26 commits intoshbiswas/upstream_0815from
Conversation
liligwu
requested changes
Aug 18, 2025
|
|
||
| const bool use_deterministic_algorithms = at::globalContext().deterministicAlgorithms(); | ||
| const int max_segment_length_per_cta = use_deterministic_algorithms ? INT_MAX : 1024; | ||
| const int max_segment_length_per_cta = use_deterministic_algorithms ? INT_MAX : 4096; |
Collaborator
There was a problem hiding this comment.
We need to guard the change by #ifdef USE_ROCM
| // Compute shared memory size for cta_per_row | ||
| constexpr auto kCacheAccBytes = sizeof(at::acc_type<cache_t, true>); | ||
| int32_t num_cta_per_row_groups = kMaxThreads / kWarpSize; | ||
| int32_t num_cta_per_row_groups = (kMaxThreads/4) / kWarpSize; |
Collaborator
There was a problem hiding this comment.
We need to guard the change by #ifdef USE_ROCM
| || dev_weights.scalar_type() == at::ScalarType::Float; | ||
|
|
||
| if (use_hip_kernel && supported_weights_type && !mixed_D && rocm::is_supported_cdna()) | ||
| if (use_hip_kernel && !mixed_D && supported_weights_type && rocm::is_supported_cdna()) |
| // (vector is very large). | ||
| std::sort( | ||
| std::execution::par, | ||
| // std::execution::par, |
kudomcho
reviewed
Aug 18, 2025
|
|
||
| const int32_t cta_per_row_grid_size = std::min( | ||
| div_round_up(total_unique_indices, kMaxThreads), | ||
| div_round_up(total_unique_indices, (kMaxThreads/4)), |
Author
|
@liligwu changes are tested. Builds successfully. Few backwards and forwards were tested. no regression |
avbokovoy
approved these changes
Aug 19, 2025
fbgemm_gpu/cmake/Hip.cmake
Outdated
| list(APPEND HIP_CXX_FLAGS -mf16c) | ||
| list(APPEND HIP_CXX_FLAGS -mfma) | ||
| list(APPEND HIP_CXX_FLAGS -std=c++20) | ||
| list(APPEND HIP_CXX_FLAGS -g) |
There was a problem hiding this comment.
I suggest to revert the whole file changes since it only increases build time and diff in this context
| // Now sort the indices by their tags. Use parallel sort for some extra speed | ||
| // (vector is very large). | ||
| std::sort( | ||
| std::execution::par, |
warp per row wg change
…d opt size and adjusted WG size for L=1 on hip split embed kernel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.