Skip to content

Revert JAX Content in Newton's Method #340

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

Merged
merged 26 commits into from
Jun 6, 2023
Merged

Revert JAX Content in Newton's Method #340

merged 26 commits into from
Jun 6, 2023

Conversation

HumphreyYang
Copy link
Collaborator

This resolves #339.

@HumphreyYang
Copy link
Collaborator Author

Hi @mmcky,

Could you please send me the error log, as the error did not appear in my local build?

Many thanks in advance.

@mmcky
Copy link
Contributor

mmcky commented May 9, 2023

@HumphreyYang if you:

  1. click on the failed build link
  2. click on Summary in the left hand column

you can download the execution error reports as a build artifact.

@mmcky
Copy link
Contributor

mmcky commented May 9, 2023

In this case the error is

ValueError: shapes (3,3) and (3000,) not aligned: 3 (dim 1) != 3000 (dim 0)

from this cell

nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
------------------
e(p, A, b, c)
------------------

@HumphreyYang
Copy link
Collaborator Author

Many thanks @mmcky,

This is strange. I just couldn't replicate the error locally and the error is not related to the environment. Would you mind resetting the cache so that I can have another go?

@mmcky
Copy link
Contributor

mmcky commented May 10, 2023

@HumphreyYang is this expected behaviour for iteration == 1

Screenshot 2023-05-10 at 12 56 47 pm

@HumphreyYang
Copy link
Collaborator Author

@HumphreyYang is this expected behaviour for iteration == 1

Screenshot 2023-05-10 at 12 56 47 pm

Many thanks @mmcky,

This is expected as it shows sometimes newton's method can fail.

@HumphreyYang
Copy link
Collaborator Author

HumphreyYang commented May 10, 2023

Hi @mmcky,

The errors now are:

/__w/lecture-python.myst/lecture-python.myst/lectures/mccall_model.md:687: WARNING: Could not lex literal_block as "ipythontb". Highlighting skipped.
/__w/lecture-python.myst/lecture-python.myst/lectures/career.md:470: WARNING: Could not lex literal_block as "ipythontb". Highlighting skipped.

Any ideas on how should I resolve them?

Many thanks in advance.

@mmcky
Copy link
Contributor

mmcky commented May 10, 2023

Hi @mmcky,

The errors now are:

/__w/lecture-python.myst/lecture-python.myst/lectures/mccall_model.md:687: WARNING: Could not lex literal_block as "ipythontb". Highlighting skipped.
/__w/lecture-python.myst/lecture-python.myst/lectures/career.md:470: WARNING: Could not lex literal_block as "ipythontb". Highlighting skipped.

Any ideas on how should I resolve them?

Many thanks in advance.

Those errors mean there is some traceback in some output. Can you replicate this locally on a clean build?

@mmcky
Copy link
Contributor

mmcky commented May 10, 2023

I am getting them locally on quantecon-gpu-server1

/home/mmcky/work/lecture-python.myst/lectures/career.md:470: WARNING: Could not lex literal_block as "ipythontb". Highlighting skipped.
/home/mmcky/work/lecture-python.myst/lectures/mccall_model.md:735: WARNING: Could not lex literal_block as "ipythontb". Highlighting skipped.

and it looks like no python jit is failing

There are 2 candidate implementations:
      - Of which 2 did not match due to:


TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<function draw at 0x7f5cca47b400>) found for signature:
 
 >>> draw(array(float64, 1d, C))
 
There are 2 candidate implementations:
      - Of which 2 did not match due to:
      Overload in function 'ol_draw': File: quantecon/random/utilities.py: Line 213.
        With argument(s): '(array(float64, 1d, C))':
       Rejected as the implementation raised a specific error:
         TypingError: missing a required argument: 'size'
  raised from /home/mmcky/anaconda3/envs/quantecon/lib/python3.10/site-packages/numba/core/typing/templates.py:791

During: resolving callee type: Function(<function draw at 0x7f5cca47b400>)
During: typing of call at /tmp/ipykernel_130272/786420040.py (16)


File "../../../../../tmp/ipykernel_130272/786420040.py", line 16:
<source missing, REPL/exec in use?>

During: resolving callee type: type(CPUDispatcher(<function passage_time at 0x7f5cb5398d30>))
During: typing of call at /tmp/ipykernel_130272/786420040.py (25)

During: resolving callee type: type(CPUDispatcher(<function passage_time at 0x7f5cb5398d30>))
During: typing of call at /tmp/ipykernel_130272/786420040.py (25)


File "../../../../../tmp/ipykernel_130272/786420040.py", line 25:
<source missing, REPL/exec in use?>

@mmcky
Copy link
Contributor

mmcky commented May 10, 2023

@HumphreyYang I will open a separate to test build the current main to rule that out.

@github-actions
Copy link

github-actions bot commented May 16, 2023

@mmcky
Copy link
Contributor

mmcky commented May 16, 2023

@HumphreyYang
Copy link
Collaborator Author

HumphreyYang commented May 16, 2023

Hi @jstac,

This is now ready for your review. As this PR resolves some of the bugs that appeared in the CI, once this is merged (after @mmcky resolves the PDF build issue), I will do a merge in each PR to get the CI building again.

Many thanks in advance.

@mmcky mmcky mentioned this pull request May 16, 2023
@mmcky
Copy link
Contributor

mmcky commented May 16, 2023

@HumphreyYang the issue with the pdf should be fixed by #343

@HumphreyYang
Copy link
Collaborator Author

@HumphreyYang the issue with the pdf should be fixed by #343

Many thanks @mmcky. I saw the PDF has been built successfully. Please merge the PR when you are ready and I will merge main to this and hand it over to @jstac!

@mmcky
Copy link
Contributor

mmcky commented May 17, 2023

@HumphreyYang the issue with the pdf should be fixed by #343

Many thanks @mmcky. I saw the PDF has been built successfully. Please merge the PR when you are ready and I will merge main to this and hand it over to @jstac!

@HumphreyYang I merged main in so should be fixed after this build.

@mmcky mmcky requested a review from jstac May 17, 2023 02:42
@HumphreyYang
Copy link
Collaborator Author

Hi @jstac,

This PR is ready for your review. Many thanks in advance.

@HumphreyYang
Copy link
Collaborator Author

HumphreyYang commented May 23, 2023

As the bug in quantecon.py has been fixed. I will revert the temporary fix in this PR once the package is updated.

Please feel free to go ahead and merge this before we have a new publish in quantecon.py. I will track this issue once this PR is merged. Please also feel free to leave this open until the new publish.

@jstac
Copy link
Contributor

jstac commented May 27, 2023

Many thanks @HumphreyYang .

@mmcky , would you mind to keep handling this one?

@mmcky
Copy link
Contributor

mmcky commented May 29, 2023

@mmcky
Copy link
Contributor

mmcky commented May 30, 2023

@HumphreyYang I have triggered another build now that a new version of quantecon has been released

@HumphreyYang
Copy link
Collaborator Author

Hi @mmcky,

This is ready to be merged. Please kindly review these changes and let me know if further changes are needed.

Many thanks.

@mmcky
Copy link
Contributor

mmcky commented Jun 6, 2023

thanks @HumphreyYang

@mmcky mmcky merged commit 95edcd8 into main Jun 6, 2023
@mmcky mmcky deleted the revert-newton branch June 6, 2023 06:44
@HumphreyYang
Copy link
Collaborator Author

Hi @mmcky,

Should we wait for the build to come alive before we publish? I will have a quick look to see what changes were brought into the lecture.

Many thanks.

@mmcky
Copy link
Contributor

mmcky commented Jun 6, 2023

@HumphreyYang I will wait until we get green ticks on the fresh cache build before triggering a publish. That currently takes 1.5 hours so I will release the update later this evening.

@mmcky
Copy link
Contributor

mmcky commented Jun 6, 2023

@HumphreyYang please check the final build on this PR and let me know if all looks as expected. I merged to get the cache building

@HumphreyYang
Copy link
Collaborator Author

Hi @mmcky, looks like the merge got some JAX into the lecture. I will restore this branch and merge it again. Apologies for the inconvenience.

@HumphreyYang HumphreyYang restored the revert-newton branch June 6, 2023 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Remove JAX material from Newton lecture
3 participants