Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#26 from mthreads/fix_automicadd
Browse files Browse the repository at this point in the history
Fix automicadd
  • Loading branch information
caizhi-mt authored and mt-robot committed Aug 8, 2023
2 parents 6a656f5 + 51284d9 commit fe6699b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion paddle/fluid/framework/details/op_handle_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ OpHandleBase::~OpHandleBase() PADDLE_MAY_THROW {
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) || defined(PADDLE_WITH_MUSA)
for (auto &ev : events_) {
if (ev.second) {
#if defined(PADDLE_WITH_HIP)
#ifdef PADDLE_WITH_HIP
PADDLE_ENFORCE_GPU_SUCCESS(hipEventDestroy(ev.second));
#elif defined(PADDLE_WITH_MUSA)
PADDLE_ENFORCE_GPU_SUCCESS(musaEventDestroy(ev.second));
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/framework/ir/mkldnn/cpu_quantize_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle/fluid/framework/ir/mkldnn/cpu_quantize_pass.h"

#include <sstream>
Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/backends/gpu/musa/musa_device_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ limitations under the License. */

#pragma once

#define PADDLE_CUDA_FP16
// NOTE(): support float16 to half in header file.
#define PADDLE_MUSA_FP16
#include "paddle/phi/common/bfloat16.h"
#include "paddle/phi/common/complex.h"
#include "paddle/phi/common/float16.h"
Expand Down Expand Up @@ -66,7 +66,7 @@ __forceinline__ __device__ phi::dtype::float16 CudaShuffleDownSync(
template <>
__forceinline__ __device__ phi::dtype::bfloat16 CudaShuffleDownSync(
unsigned mask, phi::dtype::bfloat16 val, int delta, int width) {
#if defined(PADDLE_MUSA_BF16)
#if defined(PADDLE_MUSA_BF16) && defined(__MUSA_ARCH__) && __MUSA_ARCH__ >= 220
return phi::dtype::bfloat16(__shfl_down_sync(
mask, val.to_mt_bfloat16(), static_cast<unsigned>(delta), width));
#else
Expand Down
8 changes: 1 addition & 7 deletions paddle/phi/kernels/funcs/eigen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ file(
GLOB EIGEN_CC_SOURCES
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"*.cc")
# TODO(@caizhi): compile all cu files
file(
GLOB EIGEN_CU_SOURCES
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"s*.cu"
"p*.cu"
"b*.cu"
"c*.cu"
"e*.cu"
"l*.cu")
"*.cu")

collect_srcs(kernels_srcs SRCS ${EIGEN_CC_SOURCES} ${EIGEN_CU_SOURCES})

0 comments on commit fe6699b

Please sign in to comment.