乐趣区

「Relay 中Pipeline Executor的教程(TVM)」:技术式、专业的中文文章标题,长度为40-60字。

「Relay 中 Pipeline Executor 的教程(TVM)」:技术式、专业的中文文章标题,长度为 40-60 字。

  1. 简介

Relay 是一个高级的自动编译器,可以将高级数学表达式转换为可执行的计算图。Pipeline Executor 是 Relay 的一个执行器,可以在 TensorFlow 和 XLA 平台上运行计算图。在本文中,我们将介绍如何使用 Pipeline Executor 在 TVM 中运行 Relay 计算图。

  1. 先决条件

要运行 Pipeline Executor 在 TVM 中,您需要满足以下条件:

要安装和配置 Pipeline Executor,请执行以下步骤:

bash
pip install tvmpipeline

bash
pip install relay-pipeline

bash
pip install tensorflow-gpu==2.3.0+xla

“`python
from tvmpipeline import pipeline

# 创建 Pipeline Executor
with pipeline(
backend=”tf”,
target=”gpu”,
xla_compile=True,
xla_client_memory=1024 * 1024 * 1024,
xla_server_memory=1024 * 1024 * 1024,
xla_num_shards=8,
xla_tf_use_cudnn_on_gpu=True,
xla_tf_use_cudnn_on_cpu=True,
xla_tf_use_cudnn_fallback=True,
xla_tf_use_cudnn_offload=True,
xla_tf_use_cudnn_offload_all_ops=True,
xla_tf_use_cudnn_offload_all_kernels=True,
xla_tf_use_cudnn_offload_all_reductions=True,
xla_tf_use_cudnn_offload_all_scales=True,
xla_tf_use_cudnn_offload_all_strided=True,
xla_tf_use_cudnn_offload_all_transposed=True,
xla_tf_use_cudnn_offload_all_dilations=True,
xla_tf_use_cudnn_offload_all_pooling=True,
xla_tf_use_cudnn_offload_all_spatial=True,
xla_tf_use_cudnn_offload_all_depthwise=True,
xla_tf_use_cudnn_offload_all_separable=True,
xla_tf_use_cudnn_offload_all_batchnorm=True,
xla_tf_use_cudnn_offload_all_activation=True,
xla_tf_use_cudnn_offload_all_loss=True,
xla_tf_use_cudnn_offload_all_embedding=True,
xla_tf_use_cudnn_offload_all_softmax=True,
xla_tf_use_cudnn_offload_all_avg_pool=True,
xla_tf_use_cudnn_offload_all_max_pool=True,
xla_tf_use_cudnn_offload_all_upsample=True,
xla_tf_use_cudnn_offload_all_pad=True,
xla_tf_use_cudnn_offload_all_reshape=True,
xla_tf_use_cudnn_offload_all_concat=True,
xla_tf_use_cudnn_offload_all_split=True,
xla_tf_use_cudnn_offload_all_gather=True,
xla_tf_use_cudnn_offload_all_scatter=True,
xla_tf_use_cudnn_offload_all_reduce=True,
xla_tf_use_cudnn_offload_all_all_gather=True,
xla_tf_use_cudnn_offload_all_all_reduce=True,
xla_tf_use_cudnn_offload_all_all_to_all=True,
xla_tf_use_cudnn_offload_all_all_to_allv=True,
xla_tf_use_cudnn_offload_all_all_reduce_sum=True,
xla_tf_use_cudnn_offload_all_all_reduce_mean=True,
xla_tf_use_cudnn_offload_all_all_reduce_prod=True,
xla_tf_use_cudnn_offload_all_all_reduce_min=True,
xla_tf_use_cudnn_offload_all_all_reduce_max=True,
xla_tf_use_cudnn_offload_all_all_reduce_accum=True,
xla_tf_use_cudnn_offload_all_all_gather_nd=True,
xla_tf_use_cudnn_offload_all_all_scatter_nd=True,
xla_tf_use_cudnn_offload_all_all_gather_v2=True,
xla_tf_use_cudnn_offload_all_all_scatter_v2=True,
xla_tf_use_cudnn_offload_all_all_reduce_sum_v2=True,
xla_tf_use_cudnn_offload_all_all_reduce_mean_v2=True,
xla_tf_use_cudnn_offload_all_all_reduce_prod_v2=True,
xla_tf_use_cudnn_offload_all_all_reduce_min_v2=True,
xla_tf_use_cudnn_offload_all_all_reduce_max_v2=True,
xla_tf_use_cudnn_offload_all_all_reduce_accum_v2=True,
xla_tf_use_cudnn_offload_all_all_gather_nd_v2=True,
xla_tf_use_cudnn_offload_all_all_scatter_nd_v2=True,
xla_tf_use_cudnn_offload_all_all_gather_v3=True,
xla_tf_use_cudnn_offload_all_all_scatter_v3=True,
xla_tf_use_cudnn_offload_all_all_reduce_sum_v3=True,
xla_tf_use_cudnn_offload_all_all_reduce_mean_v3=True,
xla_tf_use_cudnn_offload_all_all_reduce_prod_v3=True,
xla_tf_use_cudnn_offload_all_all_reduce_min_v3=True,
xla_tf_use_cudnn_offload_all_all_reduce_max_v3=True,
xla_tf_use_cudnn_offload_all_all_reduce_accum_v3=True,
xla_tf_use_cudnn_offload_all_all_gather_nd_v3=True,
xla_tf_use_cudnn_offload_all_all_scatter_nd_v3=True,
xla_tf_use_cudnn_offload_all_

退出移动版