tinygrad icon indicating copy to clipboard operation
tinygrad copied to clipboard

tinytqdm write support

Open francislata opened this issue 1 year ago • 1 comments

Overview This PR adds support for write that is commonly used in quite a few examples.

Here's an example of it after running the following:

from tinytqdm.helpers import tqdm
for i in tqdm(range(10)):
  tqdm.write(str(i))
Screenshot 2024-09-04 at 15 23 14

francislata avatar Sep 05 '24 02:09 francislata

looks good, minor comment about test. Also have you run any full mlperf example? running anyone suffices but want to make sure the output logs are fine

let me test it with a full mlperf example and update the test case as well .

francislata avatar Sep 08 '24 04:09 francislata

@chenyuxyz

Also have you run any full mlperf example? running anyone suffices but want to make sure the output logs are fine

the outputs do match between tqdm and tinytqdm:

tinytqdm tqdm
tinytqdm tqdm

francislata avatar Sep 20 '24 15:09 francislata

https://github.com/tinygrad/tinygrad/actions/runs/10963049261/job/30443684158?pr=6359 it seems to have one more newline compared to tqdm (you can check the ones in master) image

chenyuxyz avatar Sep 20 '24 16:09 chenyuxyz

https://github.com/tinygrad/tinygrad/actions/runs/10963049261/job/30443684158?pr=6359 it seems to have one more newline compared to tqdm (you can check the ones in master)

@chenyuxyz that's interesting. running the same command locally, i didn't find anything unusual on my terminal printing newlines. i added a force flush when write is called. also, i was going to verify this myself but since i don't have the access to push to update_benchmarks, i'll leave it up to you to check again. i'll try to reproduce it on my end, if possible.

francislata avatar Sep 20 '24 19:09 francislata

just pushed, still seeing extra rows

chenyuxyz avatar Sep 23 '24 10:09 chenyuxyz

Changes

Name                   Lines    Diff    Tokens/Line    Diff
-------------------  -------  ------  -------------  ------
tinygrad/helpers.py      279      +2           15.5    -0.0


total lines changes: +2

github-actions[bot] avatar Oct 16 '24 17:10 github-actions[bot]

@chenyuxyz - it looks like terminal and wandb look good: Screenshot 2024-10-16 at 13 53 29 Screenshot 2024-10-16 at 13 52 42

francislata avatar Oct 16 '24 17:10 francislata

training bert seems fine too https://wandb.ai/chenyuxyz/MLPerf-BERT/runs/m086t2l8?nw=nwuserchenyuxyz. will merge after CI finishes

chenyuxyz avatar Oct 16 '24 18:10 chenyuxyz