-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2024-10-04 nightly release (a0966e8)
- Loading branch information
pytorchbot
committed
Oct 4, 2024
1 parent
2127673
commit d1fa47f
Showing
7 changed files
with
568 additions
and
473 deletions.
There are no files selected for viewing
This file contains 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
44 changes: 44 additions & 0 deletions
44
fbgemm_gpu/experimental/gen_ai/src/quantize/ck_extensions/ck_utility.hip
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include <cstdlib> | ||
#include <functional> | ||
#include <initializer_list> | ||
#include <iostream> | ||
#include <numeric> | ||
#include <tuple> | ||
#include <unordered_map> | ||
|
||
#include <ATen/ATen.h> | ||
#include <c10/hip/HIPStream.h> | ||
#include <torch/torch.h> | ||
|
||
#if defined(USE_ROCM) | ||
|
||
#include "ck/ck.hpp" | ||
#include "ck/stream_config.hpp" | ||
#include "ck/host_utility/hip_check_error.hpp" | ||
#include "ck/utility/flush_icache.hpp" | ||
|
||
namespace fbgemm_gpu { | ||
|
||
void flush_icache_ck() | ||
{ | ||
hipDeviceProp_t deviceProps; | ||
hip_check_error(hipGetDeviceProperties(&deviceProps, 0)); | ||
int32_t gpu_block3 = deviceProps.multiProcessorCount * 60; | ||
|
||
auto stream = at::cuda::getCurrentHIPStream().stream(); | ||
|
||
ck::flush_icache<<<dim3(gpu_block3), dim3(64), 0, stream>>>(); | ||
hip_check_error(hipGetLastError()); | ||
} | ||
|
||
} // namespace fbgemm_gpu | ||
|
||
#endif // defined(USE_ROCM) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.