Increase GPU load Mac M1 Tensorflow

Issue

I’m new to tensorflow and using the GPU on my M1 Mac. Running my code, I observed a max GPU load of about 45%. Is there a way to increase this up to about 100%?

enter image description here

I’m using tensorflow in the following conda environment:

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:

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.

Solution

Your GPU appears to be underutilized because it can’t perform faster than you instruct it to.

Typically you can increase the GPU load by increasing the batch dimension — all else being equal.

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%.

Answered By – Jeshua Lacock

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published