Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow 2.14 on Apple Silicon CPU (not GPU) - for performance comparison #36

Open
obriensystems opened this issue Dec 3, 2024 · 0 comments
Assignees

Comments

@obriensystems
Copy link
Member

obriensystems commented Dec 3, 2024

GPU parallelism works out of the box - see #32
CPU parallelism seems to be defaulted at 33% of the cores
Attempting to optimize for M1 Max (10 core 8p/2e) and M4 Max (16 core 12p/4e)

set the threads to 4 x the total number of cores

M1Max = 10 (8p/2e) = 40 threads
M1Max = 16 (12p/4e) = 64 threads

M1 Max
default parallelism for
os.environ["OMP_NUM_THREADS"] = "10"
tf.config.threading.set_inter_op_parallelism_threads(0)
tf.config.threading.set_intra_op_parallelism_threads(0)

 Python	359.3	1:17.32	60	7	Apple	0.0	0.01	61795	michaelobrien		0 bytes	0 bytes	0 bytes	No	No	No	(null)	No	0 bytes	0	0 bytes	0	0 bytes	0 bytes	0 bytes	-	0 bytes	0 bytes	No	(null)	

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant