Unverified Commit 8d3b62d8 authored by Tim Moon's avatar Tim Moon Committed by GitHub
Browse files

[Paddle] Replace paddle.fluid imports with paddle.base (#633)



* Replace paddle.fluid imports with paddle.base
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>

* Remove paddle.fluid usage from tests
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>

---------
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>
Co-authored-by: default avatarKirthi Shankar Sivamani <ksivamani@nvidia.com>
parent ef4b1d1a
......@@ -22,5 +22,5 @@ then
cp $TE_PATH/qa/L0_paddle_lint/pylintrc $TE_PATH
cd $TE_PATH
echo "Checking Python files"
pylint --recursive=y transformer_engine/common transformer_engine/paddle
python -m pylint --recursive=y transformer_engine/common transformer_engine/paddle
fi
......@@ -10,7 +10,10 @@ import subprocess
import time
import unittest
from paddle import fluid
try:
from paddle.base import core
except ImportError:
from paddle.fluid import core
from paddle.distributed.utils.launch_utils import (
TrainerProc,
find_free_ports,
......@@ -114,7 +117,7 @@ class TestDistributed(unittest.TestCase):
allocator_strategy="auto_growth",
):
"""Run target file in subprocesses"""
if (not fluid.core.is_compiled_with_cuda() or fluid.core.get_cuda_device_count() == 0):
if (not core.is_compiled_with_cuda() or core.get_cuda_device_count() == 0):
return
selected_gpus = get_gpus('0,1')
......
......@@ -12,8 +12,12 @@ from typing import Generator, Dict, Tuple, Union, Any, List, Optional
import numpy as np
import paddle
from paddle.fluid import core
from paddle.fluid.framework import _dygraph_tracer
try:
from paddle.base import core
from paddle.base.framework import _dygraph_tracer
except ImportError:
from paddle.fluid import core
from paddle.fluid.framework import _dygraph_tracer
from ..constants import FP8BwdTensors, dist_group_type
from ..cpp_extensions import cast_transpose, cast_transpose_bgrad, cast_to_fp8, transpose
......
......@@ -5,7 +5,10 @@
from contextlib import contextmanager
from paddle.fluid import core
try:
from paddle.base import core
except ImportError:
from paddle.fluid import core
@contextmanager
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment