未验证 提交 18c86fb2 编写于 作者: L Leo Chen 提交者: GitHub

hide some logs of p2p (#28307)

上级 4086f48e
...@@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include <string.h> // for strdup #include <string.h> // for strdup
#include <algorithm> #include <algorithm>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
...@@ -105,8 +106,8 @@ void InitP2P(std::vector<int> devices) { ...@@ -105,8 +106,8 @@ void InitP2P(std::vector<int> devices) {
PADDLE_ENFORCE_CUDA_SUCCESS( PADDLE_ENFORCE_CUDA_SUCCESS(
cudaDeviceCanAccessPeer(&can_acess, devices[i], devices[j])); cudaDeviceCanAccessPeer(&can_acess, devices[i], devices[j]));
if (can_acess != 1) { if (can_acess != 1) {
LOG(WARNING) << "Cannot enable P2P access from " << devices[i] VLOG(2) << "Cannot enable P2P access from " << devices[i] << " to "
<< " to " << devices[j]; << devices[j];
} else { } else {
platform::CUDADeviceGuard guard(devices[i]); platform::CUDADeviceGuard guard(devices[i]);
cudaDeviceEnablePeerAccess(devices[j], 0); cudaDeviceEnablePeerAccess(devices[j], 0);
......
...@@ -152,6 +152,9 @@ def __bootstrap__(): ...@@ -152,6 +152,9 @@ def __bootstrap__():
import platform import platform
from . import core from . import core
# NOTE(zhiqiu): When (1)numpy < 1.19; (2) python < 3.7,
# unittest is always imported in numpy (maybe some versions not).
# so is_test is True and p2p is not inited.
in_test = 'unittest' in sys.modules in_test = 'unittest' in sys.modules
try: try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册