未验证 提交 987fb2d8 编写于 作者: 张春乔 提交者: GitHub

rm mlu (#53194)

上级 b06ec0c7
...@@ -57,7 +57,7 @@ OpSupportedInfos(const std::string& place, ...@@ -57,7 +57,7 @@ OpSupportedInfos(const std::string& place,
0, 0,
platform::errors::InvalidArgument( platform::errors::InvalidArgument(
"The argument `place` should be 'GPU', 'CPU', 'XPU', " "The argument `place` should be 'GPU', 'CPU', 'XPU', "
"'NPU', 'MLU', but got '%s'.", "'NPU', but got '%s'.",
place)); place));
std::unordered_set<std::string> all_ops; std::unordered_set<std::string> all_ops;
...@@ -148,7 +148,7 @@ AmpOperators::AmpOperators() ...@@ -148,7 +148,7 @@ AmpOperators::AmpOperators()
OpSupportedInfos("GPU", paddle::framework::proto::VarType::BF16)); OpSupportedInfos("GPU", paddle::framework::proto::VarType::BF16));
unsupported_bf16_ops_->insert(unsupported_ops_gpu_bf16.begin(), unsupported_bf16_ops_->insert(unsupported_ops_gpu_bf16.begin(),
unsupported_ops_gpu_bf16.end()); unsupported_ops_gpu_bf16.end());
// NOTE: GPU/NPU/XPU/MLU is compiled seperatly. // NOTE: GPU/NPU/XPU is compiled seperatly.
#elif defined(PADDLE_WITH_XPU) #elif defined(PADDLE_WITH_XPU)
auto unsupported_ops_xpu_fp16 = std::get<2>( auto unsupported_ops_xpu_fp16 = std::get<2>(
OpSupportedInfos("XPU", paddle::framework::proto::VarType::FP16)); OpSupportedInfos("XPU", paddle::framework::proto::VarType::FP16));
......
...@@ -57,14 +57,14 @@ class CCommInitOp : public framework::OperatorBase { ...@@ -57,14 +57,14 @@ class CCommInitOp : public framework::OperatorBase {
using CommContext = platform::BKCLCommContext; using CommContext = platform::BKCLCommContext;
#else #else
PADDLE_THROW(platform::errors::PreconditionNotMet( PADDLE_THROW(platform::errors::PreconditionNotMet(
"PaddlePaddle should be compiled with GPU or XPU or MLU.")); "PaddlePaddle should be compiled with GPU or XPU."));
#endif #endif
PADDLE_ENFORCE_EQ( PADDLE_ENFORCE_EQ(
platform::is_gpu_place(place) || platform::is_xpu_place(place), platform::is_gpu_place(place) || platform::is_xpu_place(place),
true, true,
platform::errors::PreconditionNotMet( platform::errors::PreconditionNotMet(
"CCommInitOp can run on gpu or xpu or mlu place only.")); "CCommInitOp can run on gpu or xpu place only."));
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \ #if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \
defined(PADDLE_WITH_XPU_BKCL) defined(PADDLE_WITH_XPU_BKCL)
......
...@@ -80,7 +80,7 @@ phi::KernelKey GetReduceExpectedKernelType( ...@@ -80,7 +80,7 @@ phi::KernelKey GetReduceExpectedKernelType(
platform::is_custom_place(ctx.GetPlace()), platform::is_custom_place(ctx.GetPlace()),
true, true,
platform::errors::InvalidArgument( platform::errors::InvalidArgument(
"float16 can only be used on GPU or NPU or MLU or XPU place")); "float16 can only be used on GPU or NPU or XPU place"));
} }
return phi::KernelKey(input_data_type, ctx.GetPlace()); return phi::KernelKey(input_data_type, ctx.GetPlace());
} }
......
...@@ -629,7 +629,7 @@ class ReduceBaseOp : public framework::OperatorWithKernel { ...@@ -629,7 +629,7 @@ class ReduceBaseOp : public framework::OperatorWithKernel {
platform::is_custom_place(ctx.GetPlace()), platform::is_custom_place(ctx.GetPlace()),
true, true,
platform::errors::InvalidArgument( platform::errors::InvalidArgument(
"float16 can only be used on GPU or NPU or MLU or XPU place")); "float16 can only be used on GPU or NPU or XPU place"));
} }
return phi::KernelKey(input_data_type, ctx.GetPlace()); return phi::KernelKey(input_data_type, ctx.GetPlace());
} }
......
...@@ -48,7 +48,7 @@ class SoftmaxOp : public framework::OperatorWithKernel { ...@@ -48,7 +48,7 @@ class SoftmaxOp : public framework::OperatorWithKernel {
platform::is_custom_place(ctx.GetPlace()), platform::is_custom_place(ctx.GetPlace()),
true, true,
platform::errors::InvalidArgument( platform::errors::InvalidArgument(
"float16 can only be used on GPU/NPU/XPU/MLU and custom place")); "float16 can only be used on GPU/NPU/XPU and custom place"));
} }
return phi::KernelKey( return phi::KernelKey(
ctx.GetPlace(), layout_, phi::TransToPhiDataType(input_data_type)); ctx.GetPlace(), layout_, phi::TransToPhiDataType(input_data_type));
...@@ -132,7 +132,7 @@ class SoftmaxOpGrad : public framework::OperatorWithKernel { ...@@ -132,7 +132,7 @@ class SoftmaxOpGrad : public framework::OperatorWithKernel {
platform::is_xpu_place(ctx.GetPlace()) || platform::is_xpu_place(ctx.GetPlace()) ||
platform::is_custom_place(ctx.GetPlace()))) platform::is_custom_place(ctx.GetPlace())))
PADDLE_THROW(platform::errors::InvalidArgument( PADDLE_THROW(platform::errors::InvalidArgument(
"float16 can only be used on GPU/NPU/XPU/MLU and custom place")); "float16 can only be used on GPU/NPU/XPU and custom place"));
} }
return phi::KernelKey( return phi::KernelKey(
ctx.GetPlace(), layout_, phi::TransToPhiDataType(input_data_type)); ctx.GetPlace(), layout_, phi::TransToPhiDataType(input_data_type));
......
...@@ -96,7 +96,6 @@ enum DeviceType { ...@@ -96,7 +96,6 @@ enum DeviceType {
NPU = 2, NPU = 2,
XPU = 3, XPU = 3,
IPU = 4, IPU = 4,
MLU = 5,
CUSTOM_DEVICE = 6, CUSTOM_DEVICE = 6,
MAX_DEVICE_TYPES = 7, MAX_DEVICE_TYPES = 7,
......
...@@ -46,8 +46,6 @@ enum TracerEventTypeProto { ...@@ -46,8 +46,6 @@ enum TracerEventTypeProto {
PythonOp = 13; PythonOp = 13;
// Used to mark python level userdefined // Used to mark python level userdefined
PythonUserDefined = 14; PythonUserDefined = 14;
// Used to mark mlu runtime record returned by cnpapi
MluRuntime = 15;
}; };
enum TracerMemEventTypeProto { enum TracerMemEventTypeProto {
......
...@@ -39,7 +39,7 @@ static constexpr uint32_t kProfileCustomDeviceOptionBit = 3; ...@@ -39,7 +39,7 @@ static constexpr uint32_t kProfileCustomDeviceOptionBit = 3;
void SynchronizeDevice(); void SynchronizeDevice();
struct ProfilerOptions { struct ProfilerOptions {
uint32_t trace_switch = 0; // bit 0: cpu, bit 1: gpu, bit 2: mlu uint32_t trace_switch = 0; // bit 0: cpu, bit 1: gpu
uint32_t trace_level = FLAGS_host_trace_level; uint32_t trace_level = FLAGS_host_trace_level;
}; };
......
...@@ -155,7 +155,7 @@ static const platform::Place PyObjectToPlace(const py::object &place_obj) { ...@@ -155,7 +155,7 @@ static const platform::Place PyObjectToPlace(const py::object &place_obj) {
PADDLE_THROW(platform::errors::InvalidArgument( PADDLE_THROW(platform::errors::InvalidArgument(
"Place should be one of " "Place should be one of "
"Place/CPUPlace/XPUPlace/CUDAPlace/CUDAPinnedPlace/NPUPlace/IPUPlace/" "Place/CPUPlace/XPUPlace/CUDAPlace/CUDAPinnedPlace/NPUPlace/IPUPlace/"
"MLUPlace/CustomPlace")); "CustomPlace"));
} }
} }
...@@ -209,8 +209,7 @@ static void InitVarBaseAndTensor(imperative::VarBase *self, ...@@ -209,8 +209,7 @@ static void InitVarBaseAndTensor(imperative::VarBase *self,
} else { } else {
PADDLE_THROW(platform::errors::InvalidArgument( PADDLE_THROW(platform::errors::InvalidArgument(
"Place should be one of " "Place should be one of "
"CPUPlace/XPUPlace/CUDAPlace/CUDAPinnedPlace/NPUPlace/IPUPlace/" "CPUPlace/XPUPlace/CUDAPlace/CUDAPinnedPlace/NPUPlace/IPUPlace/"));
"MLUPlace"));
} }
self->SetDataType(framework::TransToProtoVarType(tensor->dtype())); self->SetDataType(framework::TransToProtoVarType(tensor->dtype()));
} }
...@@ -2214,7 +2213,7 @@ void BindImperative(py::module *m_ptr) { ...@@ -2214,7 +2213,7 @@ void BindImperative(py::module *m_ptr) {
} else { } else {
PADDLE_THROW(platform::errors::InvalidArgument( PADDLE_THROW(platform::errors::InvalidArgument(
"Incompatible Place Type: supports XPUPlace, CUDAPlace, " "Incompatible Place Type: supports XPUPlace, CUDAPlace, "
"CPUPlace, NPUPlace, IPUPlace, MLUPlace" "CPUPlace, NPUPlace, IPUPlace"
"and CUDAPinnedPlace, " "and CUDAPinnedPlace, "
"but got Unknown Type!")); "but got Unknown Type!"));
} }
......
...@@ -51,8 +51,6 @@ enum class TracerEventType { ...@@ -51,8 +51,6 @@ enum class TracerEventType {
PythonOp = 13, PythonOp = 13,
// Used to mark python level userdefined // Used to mark python level userdefined
PythonUserDefined = 14, PythonUserDefined = 14,
// Used to mark mlu runtime record returned by cnpapi
MluRuntime = 15,
// A flag to denote the number of current types // A flag to denote the number of current types
NumTypes NumTypes
}; };
......
...@@ -53,7 +53,6 @@ enum class Backend : uint8_t { ...@@ -53,7 +53,6 @@ enum class Backend : uint8_t {
// various acceleration devices' backends // various acceleration devices' backends
XPU, // XPU currently does not exist at the same time as CUDA XPU, // XPU currently does not exist at the same time as CUDA
NPU, // NPU currently does not exist at the same time as CUDA NPU, // NPU currently does not exist at the same time as CUDA
MLU, // MLU currently does not exist at the same time as CUDA
IPU, IPU,
// paddle kernel primitives backend // paddle kernel primitives backend
......
...@@ -34,7 +34,6 @@ enum class AllocationType : int8_t { ...@@ -34,7 +34,6 @@ enum class AllocationType : int8_t {
NPU = 5, NPU = 5,
NPUPINNED = 6, NPUPINNED = 6,
IPU = 7, IPU = 7,
MLU = 8,
CUSTOM = 9, CUSTOM = 9,
}; };
......
...@@ -349,7 +349,7 @@ def amp_guard( ...@@ -349,7 +349,7 @@ def amp_guard(
or tracer._expected_place.is_custom_place() or tracer._expected_place.is_custom_place()
): ):
warnings.warn( warnings.warn(
'amp_guard can only be enabled on CUDAPlace, XPUPlace, MLUPlace, NPUPlace, and CustomPlace, current place is %s, so it makes no effect.' 'amp_guard can only be enabled on CUDAPlace, XPUPlace, NPUPlace, and CustomPlace, current place is %s, so it makes no effect.'
% tracer._expected_place % tracer._expected_place
) )
enable = False enable = False
......
...@@ -108,7 +108,7 @@ class AmpScaler: ...@@ -108,7 +108,7 @@ class AmpScaler:
or tracer._expected_place.is_custom_place() or tracer._expected_place.is_custom_place()
): ):
warnings.warn( warnings.warn(
'AmpScaler can only be enabled on CUDAPlace, XPUPlace, MLUPlace and CustomPlace, current place is %s, so it makes no effect.' 'AmpScaler can only be enabled on CUDAPlace, XPUPlace and CustomPlace, current place is %s, so it makes no effect.'
% tracer._expected_place % tracer._expected_place
) )
enable = False enable = False
......
...@@ -52,7 +52,7 @@ def launch(): ...@@ -52,7 +52,7 @@ def launch():
- ``--job_id``: The job unique id, it affects the log files' name. e.g., ``--job_id=job1``. Default ``--job_id=default``. - ``--job_id``: The job unique id, it affects the log files' name. e.g., ``--job_id=job1``. Default ``--job_id=default``.
- ``--devices``: The selected accelerate devices on nodes, can be gpu/xpu/npu/mlu etc.. e.g., ``--devices=0,1,2,3`` will launch four training processes each bound to one device. - ``--devices``: The selected accelerate devices on nodes, can be gpu/xpu/npu etc.. e.g., ``--devices=0,1,2,3`` will launch four training processes each bound to one device.
- ``training_script``: The full path to the single GPU training program/script to be launched in parallel, followed by all the arguments for the training script. e.g., ``training.py`` - ``training_script``: The full path to the single GPU training program/script to be launched in parallel, followed by all the arguments for the training script. e.g., ``training.py``
......
...@@ -428,9 +428,9 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options): ...@@ -428,9 +428,9 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options):
Start multiple processes with ``spawn`` method for parallel training. Start multiple processes with ``spawn`` method for parallel training.
.. note:: .. note::
``spawn`` now only supports GPU or XPU or MLU collective mode. The collective mode ``spawn`` now only supports GPU or XPU collective mode. The collective mode
of GPU and XPU and MLU cannot be started at the same time, so the option `gpus` and of GPU and XPU cannot be started at the same time, so the option `gpus` and
`xpus` and 'mlus' cannot be configured at the same time. `xpus` cannot be configured at the same time.
Args: Args:
func (function): The target function is called by spawned process. func (function): The target function is called by spawned process.
...@@ -457,8 +457,6 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options): ...@@ -457,8 +457,6 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options):
selected gpus, such as "0,1,2,3". Default: None; selected gpus, such as "0,1,2,3". Default: None;
(3) xpus (string): The training process will run on the (3) xpus (string): The training process will run on the
selected xpus, such as "0,1,2,3". Default: None; selected xpus, such as "0,1,2,3". Default: None;
(4) mlus (string): The training process will run on the
selected mlus, such as "0,1,2,3". Default: None;
(5) ips (string): Paddle cluster nodes ips, such as (5) ips (string): Paddle cluster nodes ips, such as
"192.168.0.16,192.168.0.17". Default: "127.0.0.1" . "192.168.0.16,192.168.0.17". Default: "127.0.0.1" .
......
...@@ -98,19 +98,16 @@ class ProfilerState(Enum): ...@@ -98,19 +98,16 @@ class ProfilerState(Enum):
class ProfilerTarget(Enum): class ProfilerTarget(Enum):
r""" r"""
ProfilerTarget is used to specify target device for :ref:`profiling <api_paddle_profiler_Profiler>` . Only CPU, GPU and MLU are supported currently. ProfilerTarget is used to specify target device for :ref:`profiling <api_paddle_profiler_Profiler>` . Only CPU and GPU are supported currently.
The meaning of each ProfilerState is as following The meaning of each ProfilerState is as following
- **ProfilerTarget.CPU** : Profile events on CPU. - **ProfilerTarget.CPU** : Profile events on CPU.
- **ProfilerTarget.GPU** : Profile events on GPU. - **ProfilerTarget.GPU** : Profile events on GPU.
- **ProfilerTarget.MLU** : Profile events on MLU.
""" """
CPU = 0 CPU = 0
GPU = 1 GPU = 1
MLU = 2
CUSTOM_DEVICE = 3 CUSTOM_DEVICE = 3
...@@ -335,7 +332,6 @@ def _get_supported_targets() -> Iterable[ProfilerTarget]: ...@@ -335,7 +332,6 @@ def _get_supported_targets() -> Iterable[ProfilerTarget]:
if _Profiler.is_cnpapi_supported(): if _Profiler.is_cnpapi_supported():
return [ return [
ProfilerTarget.CPU, ProfilerTarget.CPU,
ProfilerTarget.MLU,
ProfilerTarget.CUSTOM_DEVICE, ProfilerTarget.CUSTOM_DEVICE,
] ]
return [ProfilerTarget.CPU, ProfilerTarget.CUSTOM_DEVICE] return [ProfilerTarget.CPU, ProfilerTarget.CUSTOM_DEVICE]
...@@ -346,7 +342,7 @@ class Profiler: ...@@ -346,7 +342,7 @@ class Profiler:
Profiler context manager, user interface to manage profiling process to start, stop, export profiling data and print summary table. Profiler context manager, user interface to manage profiling process to start, stop, export profiling data and print summary table.
Args: Args:
targets (list, optional): specify target devices to profile, and all existing and supported devices will be chosen by default. Currently supported values, :ref:`ProfilerTarget.CPU <api_paddle_profiler_ProfilerTarget>` , :ref:`ProfilerTarget.GPU <api_paddle_profiler_ProfilerTarget>` and :ref:`ProfilerTarget.MLU <api_paddle_profiler_ProfilerTarget>` . targets (list, optional): specify target devices to profile, and all existing and supported devices will be chosen by default. Currently supported values, :ref:`ProfilerTarget.CPU <api_paddle_profiler_ProfilerTarget>` and :ref:`ProfilerTarget.GPU <api_paddle_profiler_ProfilerTarget>` .
scheduler (Callable|tuple, optional): If it is a callable object, it takes a step number as parameter and return the corresponding :ref:`ProfilerState <api_paddle_profiler_ProfilerState>`. This callable object can be generated by :ref:`make_scheduler <api_paddle_profiler_make_scheduler>` function. scheduler (Callable|tuple, optional): If it is a callable object, it takes a step number as parameter and return the corresponding :ref:`ProfilerState <api_paddle_profiler_ProfilerState>`. This callable object can be generated by :ref:`make_scheduler <api_paddle_profiler_make_scheduler>` function.
If not provided (None), the default scheduler will keep tracing until the profiler exits. If it is a tuple, it has two values start_batch and end_batch, If not provided (None), the default scheduler will keep tracing until the profiler exits. If it is a tuple, it has two values start_batch and end_batch,
which means profiling range [start_batch, end_batch). which means profiling range [start_batch, end_batch).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册