简体   繁体   English

增加 GPU 负载 Mac M1 Tensorflow

[英]Increase GPU load Mac M1 Tensorflow

I'm new to tensorflow and using the GPU on my M1 Mac.我是 tensorflow 新手,在我的 M1 Mac 上使用 GPU。 Running my code, I observed a max GPU load of about 45%.运行我的代码,我观察到最大 GPU 负载约为 45%。 Is there a way to increase this up to about 100%?有没有办法将其提高到大约 100%?

在此处输入图像描述

I'm using tensorflow in the following conda environment:我在以下 conda 环境中使用 tensorflow:

name: tensorflow
 
dependencies:
    - python=3.8
    - pip
    - jupyter
    - apple::tensorflow-deps
    - scikit-learn
    - scipy
    - pandas
    - pandas-datareader
    - matplotlib
    - pillow
    - tqdm
    - requests
    - h5py
    - pyyaml
    - flask
    - boto3
    - openssl
    - pip:
        - tensorflow-macos
        - tensorflow-metal
        - bayesian-optimization
        - gym
        - kaggle

And I also get the following warnings from tensorflow:而且我还从 tensorflow 收到以下警告:

I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:305] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.

I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:271] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>)

W tensorflow/core/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz

I tensorflow/core/grappler/optimizers/custom_graph_optimizer_registry.cc:113] Plugin optimizer for device_type GPU is enabled.

Your GPU appears to be underutilized because it can't perform faster than you instruct it to.您的 GPU 似乎没有得到充分利用,因为它的执行速度不能比您指示的更快。

Typically you can increase the GPU load by increasing the batch dimension -- all else being equal.通常,您可以通过增加批处理维度来增加 GPU 负载——所有其他条件都相同。

For instance, if the batch dimension is 1 with utilization at 45%, if you change the batch dimension to 2 it should be closer to 90%.例如,如果批次维度为 1,利用率为 45%,如果将批次维度更改为 2,它应该更接近 90%。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM