davidenunes / tensorflow-wheels

Tensorflow Wheels
135 stars 9 forks source link

Build request #3

Closed qguid closed 5 years ago

qguid commented 5 years ago

Hey hi, i'm a bio engineering student writing my graduate thesis this year. Since Computer vision is not my main field of study, i'm struggling since a while to make my script work !

I'm working on a remote serve so i can't build the wheel myself.

I would need something to working with FMA AVX2 and AVX512F :

-Debian 9.0 -Python 3.7.5+ (or 3.6.8) -TF 1.13.1

Would it be possible ?

I need it not only to improve my tensorflow permormances but also to simply make it work.

Faithfully,

Quentin

davidenunes commented 5 years ago

Hi Quentin,

I can try building something for Ubuntu 18.04 (since I already have the docker image at hand) with python 3.7, the available libraries shouldn't be that much different. What's the target architecture? My native is a skylake so if have instructions that you don't support I imagine it would cause some problems.

what is the output of the following command in your remote machine ? gcc -march=native -Q --help=target | grep march

qguid commented 5 years ago

Hey,

It seems to be a skylake aswell. I'm not sure what is means since i'm a newbie lol. I finally found a prebuild Tensorflow which seems to work for my FMA and AVX2 but this AV512F is still missing.

----- Mail original ----- De: "Davide Nunes" notifications@github.com À: "davidenunes/tensorflow-wheels" tensorflow-wheels@noreply.github.com Cc: "Quentin Guidosse" qguidosse@student.uliege.be, "Author" author@noreply.github.com Envoyé: Vendredi 26 Avril 2019 16:42:28 Objet: Re: [davidenunes/tensorflow-wheels] Build request (#3)

Hi Quentin,

I can try building something for Ubuntu 18.04 (since I already have the docker image at hand) with python 3.7, the available libraries shouldn't be that much different. What's the target architecture? My native is a skylake so if have instructions that you don't support I imagine it would cause some problems.

what is the output of the following command in your remote machine ? gcc -march=native -Q --help=target | grep march

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/davidenunes/tensorflow-wheels/issues/3#issuecomment-487082382

qguid commented 5 years ago

Btw i don't know if it helps but my goal is to process detection and classification on 350 000 images thx to Mask-RCNN.

----- Mail original ----- De: "Davide Nunes" notifications@github.com À: "davidenunes/tensorflow-wheels" tensorflow-wheels@noreply.github.com Cc: "Quentin Guidosse" qguidosse@student.uliege.be, "Author" author@noreply.github.com Envoyé: Vendredi 26 Avril 2019 16:42:28 Objet: Re: [davidenunes/tensorflow-wheels] Build request (#3)

Hi Quentin,

I can try building something for Ubuntu 18.04 (since I already have the docker image at hand) with python 3.7, the available libraries shouldn't be that much different. What's the target architecture? My native is a skylake so if have instructions that you don't support I imagine it would cause some problems.

what is the output of the following command in your remote machine ? gcc -march=native -Q --help=target | grep march

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/davidenunes/tensorflow-wheels/issues/3#issuecomment-487082382

davidenunes commented 5 years ago

You shouldn't have any problem without avx512f, these are instruction extensions implemented by specific skylake-x processors.

I'm trying to build one wheel for you nevertheless.

I assume TF is taking advantage of these instructions, but I wouldn't expect that big of a performance improvement. I wouldn't worry about performance at this level, unless you are sure these really make a difference. I work mostly with text, (NLP, etc) and use GPUs but still, the bottlenecks are usually somewhere else within your pipeline --especially when talking about a research setting.

qguid commented 5 years ago

Well i read it many times on internet but the script stops running after the avx512f warning. Seems weird because it was working without any problems when i was testing the script with 2 pictures and since i imported the whole batch it asks to compile Tensorflow for those components. I don't have any idea of how to avoid it, that's why i spent so much time trying to figure it out.

----- Mail original ----- De: "Davide Nunes" notifications@github.com À: "davidenunes/tensorflow-wheels" tensorflow-wheels@noreply.github.com Cc: "Quentin Guidosse" qguidosse@student.uliege.be, "Author" author@noreply.github.com Envoyé: Vendredi 26 Avril 2019 17:44:40 Objet: Re: [davidenunes/tensorflow-wheels] Build request (#3)

You shouldn't have any problem without avx512f, these are instruction extensions implemented by specific skylake-x processors. I'm trying to build one wheel for you nevertheless.

I assume TF is taking advantage of these instructions, but I wouldn't expect that big of a performance improvement. I wouldn't worry about performance at this level, unless you are sure these really make a difference. I work mostly with text, (NLP, etc) and use GPUs but still, the bottlenecks are usually somewhere else within your pipeline --especially when talking about a research setting.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/davidenunes/tensorflow-wheels/issues/3#issuecomment-487104722

davidenunes commented 5 years ago

Done, you can test this wheel here.

The warning is just there to let you know that you could take advantage of certain instructions. You can hide the warnings with:

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

What's the size of your mini-batches? Are you sure you're not just running out of memory ?

qguid commented 5 years ago

Ah crap you were right, It is working so it will be faster thanks to you, thank you ! However my script is aborting without any error afin running the tensorflow backend and I don't know what to do. How can i know if i'm out ou memory and how can i solve it ? For now i was just trying to solve this problem on a subsample of 5 photos.

----- Mail original ----- De: "Davide Nunes" notifications@github.com À: "davidenunes/tensorflow-wheels" tensorflow-wheels@noreply.github.com Cc: "Quentin Guidosse" qguidosse@student.uliege.be, "Author" author@noreply.github.com Envoyé: Vendredi 26 Avril 2019 18:09:44 Objet: Re: [davidenunes/tensorflow-wheels] Build request (#3)

Done, you can test this wheel here.

The warning is just there to let you know that you could take advantage of certain instructions. You can hide the warnings with:

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

What's the size of your mini-batches? Are you sure you're not just running out of memory ?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/davidenunes/tensorflow-wheels/issues/3#issuecomment-487112860

davidenunes commented 5 years ago

nice, glad I could help,

A subsample of 5 photos would not cause that. I was just wondering since you mentioned that you "imported the whole batch". Your machine would become unresponsive if you run out of memory.

Anyway, I assume that's a python script? I would advise you to debug on a local machine first. There's no way to know what's wrong (or for me to guess) without going into the code.

Since the wheel is working I'm closing the issue. If there's anything else I can help you with, you can DM me on Twitter @davidelnunes or use mail@davide.pt

qguid commented 5 years ago

Well finally i launched it, still can't figure out what's was going wrong. Btw you were alright, it's pretty slow even with this that much of CPU. But what is it for then ?

----- Mail original ----- De: "Davide Nunes" notifications@github.com À: "davidenunes/tensorflow-wheels" tensorflow-wheels@noreply.github.com Cc: "Quentin Guidosse" qguidosse@student.uliege.be, "Author" author@noreply.github.com Envoyé: Vendredi 26 Avril 2019 20:20:34 Objet: Re: [davidenunes/tensorflow-wheels] Build request (#3)

nice, glad I could help,

A subsample of 5 photos would not cause that. I was just wondering since you mentioned that you "imported the whole batch". Your machine would become unresponsive if you run out of memory.

Anyway, I assume that's a python script? I would advise you to debug on a local machine first. There's no way to know what's wrong (or for me to guess) without going into the code.

Since the wheel is working I'm closing the issue. If there's anything else I can help you with, you can DM me on Twitter @davidelnunes or use mail@davide.pt

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/davidenunes/tensorflow-wheels/issues/3#issuecomment-487153827

davidenunes commented 5 years ago

Even if these instructions improve the operations a little bit, there's no magic, just think about the calculations being done, the number of features, the matrix multiplications, the convolution operations.

Specialized libraries do as best as they can, but still...

That's why people use GPUs most of the time, you have some instructions speciallized for convolutions, certain computations can be done in parallel in the GPU. Sure you might find some CPUs that are cost effective, but you can't expect to trow a humongus ammount of operations at a CPU and expect it to be fast.