-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Docs][Examples]@unroll examples inconsistent, throws an error #2940
Comments
Are you using Mojo nightly? We moved away from the unroll decorator in favour of |
I am which would explain the error and the difference with the blog and unroll factor. The reason I tagged it with [Docs][Examples] is simply to note that the examples ought to be updated e.g. the people following Prakash's new "Getting Started" video would immediately run into a compile problem. |
Yes, the official documentation (on https://docs.modular.com/mojo/) is following against the latest release corresponding to the main branch, not the nightly builds. The nightly branch on github does have examples that work with the nightly though. Keeping this bug for the issues of blogs/videos getting outdated. Maybe the compatible version has to be noted. |
Thanks for raising this @DWSimmons. Our goal is go keep the examples up to date as much as we can, and we're working on some new structures to help that happen. There are instances where the docs will be out of sync (for example, with nightlies), and we may not be able to completely reconcile that. Blog posts are a good example, we have to strike a balance between talking about new features and maintaining the old posts. We may not be able to get to everything, which is why we've built the new devrel-extras repository. That gives us a place to mark known compatibility, and go back and update examples when we have the opportunity to. We have some other changes to our content that are coming soon but that I can't say much more about that will make it easier to keep the examples up to date. So we hear you loud and clear on this, and are working towards solutions to this exact problem that are scalable and maintainable. |
mojo/examples/matmul.mojo
Line 165 in bf73717
from the github mojo examples throws an error:
This line is present in the Playground and executes with no errors L131
This line is not present on https://docs.modular.com/mojo/notebooks/Matmul#vectorizing-the-inner-most-loop
and instead has
unroll_factor
in the vectorize callwhich throws no errors and compiles (if the code snippets are copy-pasted together).
https://docs.modular.com/mojo/changelog#v241-2024-02-29
(base) darin@DESKTOP-09A56TM:/mnt/p/mojo_scratch$ modular -v
modular 0.8.0 (39a426b5)
(base) darin@DESKTOP-09A56TM:/mnt/p/mojo_scratch$ mojo -v
mojo 2024.5.3112 (e60dc71f)
(base) darin@DESKTOP-09A56TM:/mnt/p/mojo_scratch$ uname -a
Linux DESKTOP-09A56TM 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Not sure where the exact problem is as the LSP says no to github raw but Playground says yes; but also, the notebook walk through works. I'm under the impression from the manual that the
@unroll
should work because it's declaring that the for loop after it should be unrolled (tile_y) times. I'm under the impression that I would have to declare it in the execution but it doesn't compile so I can't declare. Chicken and the egg.Expectation: Examples copied from github would all pass compile.
Proposed solution: ???
The text was updated successfully, but these errors were encountered: