tensorboard
tensorboard copied to clipboard
Embedding Projector: perform consistent knn calculation
Motivation for features / changes
Remove limitations on firefox when running embedding projectors Using GPU-accelerated tensorflow.js to compute knn speed up computation time for firefox on M1 Pro from 25s to 15s (~40% speedup)
Technical description of changes
- Remove webgl check since the app won't work with webgl disabled anyway.
- Removed firefox limitation. The only firefox issue I know of is that firefox has a smaller MAX_TEXTURE_SIZE of 8192x8192 (compared to Chrome's 16384x16384) on M1 pro, so knn calculation work fine with <16384 points (t-SNE is limited to 10k points). On Chrome we can do 16000 points before a memory allocation errors occurs. On Safari we can actually get more than 16384 points to work but its very slow. If GPU computation fails we always fall back to CPU calculations.
This also have the added benefit of being 2x faster than naive computation on M1 Pro.
Screenshots of UI changes
N/A
Detailed steps to verify changes work correctly (as executed by you)
Build and run Embedding Projector to ensure t-SNE and UMAP works as expected on Firefox
Alternate designs / implementations considered
Have you verified that this works on a recent Firefox build?
@bileschi
thanks for taking a look! yes firefox worked great on M1 Mac Pro and computing knn using tensorflow.js via GPU greatly speedup the process (40% speedup from 25s to 15s)!
I did also try it on my very low-end Windows 11 machine. Both (Chromium-based) Edge and Firefox was having some performance issues with t-SNE (10k points) but UMAP (5k points) worked great. I am hoping #6275 can improve perf further.