-
Notifications
You must be signed in to change notification settings - Fork 32
1623 add training #3145
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
base: master
Are you sure you want to change the base?
1623 add training #3145
Conversation
…amples fully works.
|
@arporter , I have addressed all changes. I also added a lot of additional tests, since I had at least two examples being broken that were not picked up by my testing - which was pretty bad in the actual training sessions. One issue is fixed already (and also properly tested here), one is still outstanding (#3252). The fact that this tutorial contains additional important testing makes me push for getting this in sooner than later. Otherwise we risk a never-ending PR: as PSyclone gets updated and the training is not tested, there is a chance that something breaks the training, Then I need to debug and fix this (or get help to fix this), instead of these problems being flagged when the PSyclone improvements are added (and then being fixed by the original developer before the PR is merged). Note that I have opened #3270 for additional training improvements (e.g. linking files instead of duplicating ... at least evaluating this option; adding syntax highlighting). And also #3208 to review the individual training sections. While I totally agree that this is not ideal, my suggestion would be that the review here focuses just on the testing side-of things, to get any issues there sorted out. No one has the time to proof-read all of this text material, and as mentioned, delays this PR just mean this will keep on being more work to keep this up-to-date. Yes, there is a risk that it might take a long time before this material (as in: the READMEs) gets properly updated, and I understand your reluctance. I am open for any suggestion you have, I don't have a particular brilliant idea either :( Am triggering the full CI as well. |
arporter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm enjoying going through (in outline) your game-of-life example - it's great to see that you can recover performance :-)
Since most of the example transformation scripts need their module and apply-method docstrings updating, I'm going to pause here to let you do that.
As you suggested, I'm basically ignoring the actual text of the readme's so I am by no means reviewing the actual tutorials.
| # Author: J. Henrichs, Bureau of Meteorology | ||
|
|
||
| # The transform target `test` runs tests on the gitlab CI (i.e. without | ||
| # compilation), `test_run` will compile all binaries (as far as possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean compile instead of test_run and then s/run/test_run/ on the following line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've cleaned this up (including removing the 'compile' target from the top level makefiles ... most 'local' Makefiles have a compile for the convenience when running the training, but the high level ones should only use test or test_run)
tutorial/training/Makefile
Outdated
| .PHONY: allclean clean compile test test_run | ||
|
|
||
| allclean clean compile test test_run: | ||
| $(MAKE) -C psyclone_for_lfric_users $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so this part is for LFRic users rather than developers? I think "lfric_users" would be fine since this is already under the "training" directory in the PSyclone repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do:
cd PSyclone/tutorial/training
make compilethen I get:
make -C psyclone_for_lfric_users compile
make[1]: Entering directory '/home/me/Projects/PSyclone/tutorial/training/psyclone_for_lfric_users'
make[1]: *** No rule to make target 'compile'. Stop.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a left-over target, the top level Makefiles should only support 'test' and 'test_run' (many 'lowest level' makefiles support compile, since it's convenient for the user if e.g. they want to do performance measurements), but no need to support this everywhere.
tutorial/training/README.rst
Outdated
| This is the training material for the usage of PSyclone, a code | ||
| transformation and generator tool. PSyclone was originally developed | ||
| for the UK Met Office’s new LFRic numerical weather prediction system, | ||
| but it’s features of modifying large codes based on scripts have found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"its"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| @@ -0,0 +1,90 @@ | |||
| PSyclone Training | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this Joerg - it's very helpful. Please could you also add a brief README in the directory above to explain what is contained in each of the subdirectories - i.e. it's not clear what the difference between 'training' and 'tutorial' is. Ideally, at some point, we'll probably want to merge the two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
tutorial/training/README.rst
Outdated
| more open ended, and trainees are encouraged to go back to these | ||
| examples and implement better solutions later. | ||
|
|
||
| The trainings material is split into four parts, and the files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"training"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| # ----------------------------------------------------------------------------- | ||
| # Author: J. Henrichs, Bureau of Meteorology | ||
|
|
||
| '''Python script intended to be passed to PSyclone's generate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls update.
|
|
||
| def trans(psyir): | ||
| ''' | ||
| Take the supplied psyir object, and fuse all loops. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also inlines...
|
|
||
| def trans(psyir): | ||
| ''' | ||
| Take the supplied psyir object, and fuse the last three loops. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also inlines.
| # ----------------------------------------------------------------------------- | ||
| # Author: J. Henrichs, Bureau of Meteorology | ||
|
|
||
| '''Python script intended to be passed to PSyclone's generate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls update.
|
|
||
| line_count = 0 | ||
|
|
||
| do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment please.
|
Wow, that was an impressive review. I think it took me over an hour just to add 'done' to your comments. You rightly pointed out some repeated errors (generat function, missing docstrings, inlining not mentioned). I think I've fixed them up everywhere. I've triggered the full |
|
@arporter I have a problem - turns out the OpenMP offloading does not work (anymore??). Due to a bug in the makefile, it actually hasn't applied the offloading script at all in my recent tests (I am pretty certain it did originally, but I did some refactoring/ simplifications of the Makefile, which I believe introduced this bug recently). Now I've fixed the Makefile, it aborts with: (see https://github.com/stfc/PSyclone-mirror/actions/runs/20805411529/job/59758702708) Googling indicates that there might be a mapping missing (which we don't support afaik), or additional compiler options(?). I don't know what to do. I don't have (easy) access to hardware that would support managed memory, and I am not even certain what the right solution would be in this case :( Can you (or Sergi?) help? I assume you can log onto the machine and try running it there? |
Adds the PSyclone training material (based on #3131)