tensorflow: Tensorflow profiling tool does not work on Mac M1

Click to expand!

Issue Type

Bug

Have you reproduced the bug with TF nightly?

Yes

Source

source

Tensorflow Version

2.11

Custom Code

Yes

OS Platform and Distribution

M1 Mac

Mobile device

No response

Python version

3.9

Bazel version

No response

GCC/Compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

I cannot do profiling on M1 macbook, but with the same code I can profile with linux machine (tried on colab).

Standalone code to reproduce the issue

import tensorflow as tf
from datetime import datetime

cifar = tf.keras.datasets.cifar100
(x_train, y_train), (x_test, y_test) = cifar.load_data()
model = tf.keras.applications.ResNet50(
    include_top=True,
    weights=None,
    input_shape=(32, 32, 3),
    classes=100,
)

logs = "logs/" + datetime.now().strftime("%Y%m%d-%H%M%S")

tboard_callback = tf.keras.callbacks.TensorBoard(
    log_dir=logs, histogram_freq=1, profile_batch=(50, 150)
)

loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
optimizer = tf.keras.optimizers.Adam()
legacy_optimizer = tf.keras.optimizers.legacy.Adam()
# switch optimizer to test performance
model.compile(optimizer=optimizer, loss=loss_fn, metrics=["accuracy"])

model.fit(
    x_train,
    y_train,
    epochs=2,
    batch_size=16,
    steps_per_epoch=200,
    callbacks=[tboard_callback],
)


### Relevant log output

_No response_</details>

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (12 by maintainers)

Most upvoted comments

Hi @mohantym and @chenmoneygithub, thanks for reaching out and your interest . Currently we haven’t implemented the pluggable profiler api for Metal plug-in . Is this something you are interested in?

@mohantym Thanks! I have the same profiling output, and it does generate a file. However, if you check the profile results on Tensorboard you will see nothing gets really traced, please see the screenshot in this comment