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

Increase testing granularity for speedup #3242

Merged
merged 6 commits into from Mar 7, 2021
Merged

Increase testing granularity for speedup #3242

merged 6 commits into from Mar 7, 2021

Conversation

ddobrinskiy
Copy link
Contributor

@ddobrinskiy ddobrinskiy commented Mar 6, 2021

Using 9 batches instead of 3:

Current setup of 3 batches means that 20+ notebooks fall into the [5-7] batch and it takes 9minutes to test all the notebooks, example: https://github.com/fastai/fastai/pull/3235/checks?check_run_id=1969103831

With minimal code changes, we can split notebooks into 9 batches instead of 3, which should speed-up testing

upd: with new configuration, actual notebook testing takes at most 1m20s (excluding docker setup, cache download, et cetera)

Use 9 batches instead of 3
@ddobrinskiy ddobrinskiy changed the title increase testing granularity Increase testing granularity for speedup Mar 6, 2021
@ddobrinskiy ddobrinskiy marked this pull request as draft March 6, 2021 10:57
@ddobrinskiy
Copy link
Contributor Author

Hmmm, not sure what the problem is.

The tests fail for nbs/04_data.external.ipynb saying that file is not found, full traceback below.

The CALTECH url is reachable at the moment. https://s3.amazonaws.com/fast-ai-imageclas/caltech_101.tgz

Reading from the notebook, I get a feeling that maybe this cell should not be present anyway?
image

Error in /__w/fastai/fastai/nbs/04_data.external.ipynb:
An error occurred while executing the following cell:
------------------
url = URLs.CALTECH_101
untar_data(url)
_add_check(url, URLs.path(url))
------------------

rror in /__w/fastai/fastai/nbs/04_data.external.ipynb:
An error occurred while executing the following cell:
------------------
url = URLs.CALTECH_101
untar_data(url)
_add_check(url, URLs.path(url))
------------------

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
/__w/fastai/fastai/fastai/data/external.py in <module>
      1 url = URLs.CALTECH_101
      2 untar_data(url)
----> 3 _add_check(url, URLs.path(url))

/__w/fastai/fastai/fastai/data/external.py in _add_check(url, fname)
      3     "Internal function to update the internal check file with `url` and check on `fname`."
      4     checks = json.load(open(Path(__file__).parent/'checks.txt', 'r'))
----> 5     checks[url] = _check_file(fname)
      6     json.dump(checks, open(Path(__file__).parent/'checks.txt', 'w'), indent=2)

/__w/fastai/fastai/fastai/data/external.py in _check_file(fname)
      7 def _check_file(fname):
      8     "internal function to get the hash of the local file at `fname`."
----> 9     size = os.path.getsize(fname)
     10     with open(fname, "rb") as f: hash_nb = hashlib.md5(f.read(2**20)).hexdigest()
     11     return [size,hash_nb]

/usr/lib/python3.8/genericpath.py in getsize(filename)
     48 def getsize(filename):
     49     """Return the size of a file, reported by os.stat()."""
---> 50     return os.stat(filename).st_size
     51 
     52 

FileNotFoundError: [Errno 2] No such file or directory: '/github/home/.fastai/archive/caltech_101.tgz'

David Dobrinskiy added 2 commits March 6, 2021 14:24
URLs.CALTECH_101

this cell looks like it should not be here
@ddobrinskiy
Copy link
Contributor Author

On further investigation, I can see that the cell in question was added (commit) by @jph00 couple months ago.

I don't understand why it did not fail for other PRs

@ddobrinskiy ddobrinskiy marked this pull request as ready for review March 6, 2021 11:42
@ddobrinskiy ddobrinskiy requested a review from jph00 as a code owner March 6, 2021 11:42
@jph00
Copy link
Member

jph00 commented Mar 7, 2021

Thanks!

@jph00 jph00 merged commit 00d8863 into fastai:master Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants