`ptxas 警告:Tensorflow 和 PyTorch 上的寄存器溢出到本地内存

问题描述 投票:0回答:1

在我们的一项研究中,我们将 Tensorflow 和 Pytorch 与其他主要模型一起使用。每当我们在大学使用数据服务器时,我们都可以在模型训练中使用完整的 GPU。该计算机配有 Nvidia Titan Xp 12GB GPU。

另一方面,我的家用电脑配备了 Nvidia GeForce RTX 3060 12GB GDDR6 GPU。问题是,无论我如何尝试,模型在模型训练期间都不会使用完整的 GPU。它使用了近 8 GB 半的 GPU,即使其他部分是空的并且没有其他应用程序正在使用它们。因此,epoch需要更长的时间。此外,即使数据集和笔记本相同,我也会在每个时期收到警告消息。

包含纪元相关代码的代码块如下:

num_epoch = 100
history = model.fit(
    train_dataset,
    epochs = num_epoch,
    steps_per_epoch = len(train_paths) // batch_size,
    validation_data = test_dataset,
    validation_steps= len(test_paths) // batch_size
)

我还在下面给出的每个时期收到错误,即使这可能无关紧要。

WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1715325398.195254   36322 service.cc:145] XLA service 0x7f1648003120 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
I0000 00:00:1715325398.195290   36322 service.cc:153]   StreamExecutor device (0): NVIDIA GeForce RTX 3060, Compute Capability 8.6
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1715325400.187164   36503 asm_compiler.cc:369] ptxas warning : Registers are spilled to local memory in function 'triton_gemm_dot_4361', 112 bytes spill stores, 112 bytes spill loads

I0000 00:00:1715325456.896302   36322 device_compiler.h:188] Compiled cluster using XLA!  This line is logged at most once for the lifetime of the process.

我想知道是否有任何方法可以显式强制笔记本以固定大小使用 GPU 内存。它将能够减少我家用计算机上的纪元时间。请告诉我您的想法。

tensorflow ubuntu pytorch cuda conda
1个回答
0
投票

问题已解决。

版本不匹配造成了这些问题。我尝试根据服务器计算机匹配所有版本,结果完美无缺! enter image description here

解决问题的解决方法:

  1. 创建一个新的conda环境,Python=3.7.16
  2. 使用 conda 安装 Pytorch=1.12.1
    conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 -c pytorch
  3. 通过conda安装Tensorflow GPU版本=2.4.1
© www.soinside.com 2019 - 2024. All rights reserved.