srush / Triton-Puzzles

Puzzles for learning Triton
Apache License 2.0
925 stars 57 forks source link

Running in Google Colab Free Tier may trigger warnings and disconnects #13

Open pchng opened 4 months ago

pchng commented 4 months ago

I have received the following warning twice when running in Google Colab free tier, and am wary of continuing to run the Triton Puzzles notebook because of it: (I don't want to get banned)

2024-04-20-colab-warning-triton

I have not modified the notebook in any way (other than attempt to solve the puzzles, of course).

From what I can gather, this may be some false positive due to the use of Triton-Viz and/or HTML output by the notebook. Specifically, in the Colab FAQ it's stated that these activities are disallowed in the free tier:

bypassing the notebook UI to interact primarily via a web UI

I suspect that Triton-Viz and/or HTML output by the notebook triggers this false positive (and thus the warning), although for me, this has happened sporadically - only twice. (I have finished 8 of 12 puzzles, in case that matters)

Doing a bit more digging, it appears that Google cracked down on this when Stable Diffusion Web UI usage on the free tier skyrocketed, causing usage concerns. See the following for more details:

  1. https://www.reddit.com/r/StableDiffusion/comments/12t8tc7/is_colab_going_to_start_banning_people_who_use_it/
  2. https://www.reddit.com/r/StableDiffusion/comments/17cylsx/automatic1111s_colab_runtime_disconnected_message/

There's a comment in there from a Colab PM who states:

just the webui bit is getting warned - use the models in notebooks to your heart's content. stability is awesome and I really like them.

we prioritize interactive notebook compute on the free tier, and the webUI piece grew really big fast.

This suggests that Web UIs may be the cause or factor here. I don't know enough about Triton, but I doubt the usage of Triton here would be considered the "disallowed" code.

I'm wondering if anyone else has experienced this? (The obvious mitigation would be just to purchase a plan or some credits)

Thanks,

Peter

srush commented 4 months ago

Oh weird. I wonder if this is Gradio actually. I think it uses a little webui internally.

pchng commented 4 months ago

Yeah, the stable diffusion webui (focus of those reddit posts) also uses Gradio: https://github.com/AUTOMATIC1111/stable-diffusion-webui

So my suspicion is Colab has some automagic/ML-driven detection that can flag Gradio usage as being "disallowed" in free tier. It's definitely not hard-coded since it doesn't happen 100% of the time, only occasionally, and I haven't been able to consistently reproduce it (nor do I want to). The Triton Puzzles is the first time I've run into this warning, since I haven't used any Gradio stuff there before (like the stable diffusion webui)

Anyway, this isn't a big issue, just wanted to post in case others had run into this. Thanks a bunch @srush for putting together these puzzles!

pchng commented 3 months ago

Update: I disabled all Gradio visualization and also the HTML puppies ☹️ , but since then haven't gotten any more of the Google Colab false positive warnings.

Numeri commented 3 months ago

I got this warning as well and submitted an "appeal" to the Google Colab team. Unfortunately I hadn't seen this issue yet, or I would have linked that there.