def download_file():
    """Get disabled unit tests"""
    ssl._create_default_https_context = ssl._create_unverified_context
    sysstr = sys.platform
    if sysstr == 'win32':
        url = "https://sys-p0.bj.bcebos.com/prec/{}".format('disable_ut_win')
    else:
        url = "https://sys-p0.bj.bcebos.com/prec/{}".format('disable_ut')

    if paddle.is_compiled_with_rocm():
        url = "https://sys-p0.bj.bcebos.com/prec/{}".format('disable_ut_rocm')

    if paddle.is_compiled_with_npu():
        url = "https://sys-p0.bj.bcebos.com/prec/{}".format('disable_ut_npu')

    f = requests.get(url)
    data = f.text
    status_code = f.status_code
    if len(data.strip()) == 0 or status_code != 200:
        sys.exit(1)
    else:
        lt = data.strip().split('\n')
        lt = '^' + '$|^'.join(lt) + '$'
        print(lt)
        sys.exit(0)
示例#2
0
def get_env_device():
    """
    Return the device name of running enviroment.
    """
    if paddle.is_compiled_with_cuda():
        return 'gpu'
    elif paddle.is_compiled_with_npu():
        return 'npu'
    elif paddle.is_compiled_with_rocm():
        return 'rocm'
    elif paddle.is_compiled_with_xpu():
        return 'xpu'
    return 'cpu'
示例#3
0
def is_fused_matmul_bias_supported():
    if paddle.is_compiled_with_cuda() and not paddle.is_compiled_with_rocm():
        return hasattr(core.ops, 'fused_gemm_epilogue')
    else:
        return False
示例#4
0
def can_use_cuda_graph():
    return paddle.is_compiled_with_cuda(
    ) and not paddle.is_compiled_with_rocm()