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

Intro to Julia Outline #1

Open
ejmeitz opened this issue Sep 2, 2024 · 6 comments
Open

Intro to Julia Outline #1

ejmeitz opened this issue Sep 2, 2024 · 6 comments

Comments

@ejmeitz
Copy link
Collaborator

ejmeitz commented Sep 2, 2024

Just a high-level outline of what I think would be useful to cover based on Leticia's notebooks and how I use Julia. We definitely should get more specific with the layout and who teaches what, but for now lets pin down the topics we want to cover.

  • Basic Stuff:

    • Why Julia
    • Setting up a Julia environment (VSCode, Jupyter, REPL)
    • Syntax (functions, loops, variables, types, structs, broadcasting functions, unicode characters, File I/O)
    • Multiple dispatch
    • Package manager intro
    • Common numerical packages (LinearAlgebra, DataFrames, Unitful, Distributions)
    • Plotting
    • Benchmarking & Optimizing Code (BenchmarkTools.jl, array views, memory allocations, type stability)
  • Advanced Stuff:

    • Basic parallelization (e.g. Threads)
    • Basic GPU programming (high level interface)
    • AutoDiff?? (I've only used FastDifferentiation.jl)
    • Overview of what to expect on next workshop day? (e.g. Molly, DFTK...)
@Leticia-maria
Copy link
Collaborator

Should we set up the environment before introducing "Why Julia?"? I say that because I think about introducing "Why Julia?" with examples, and it would be better to set up the environment as the very first thing so they can follow the examples.
What do you think? @rkurchin and @ejmeitz

@cortner
Copy link
Member

cortner commented Sep 2, 2024

I move long thought if ChainRules as a big selling point for Julia. But maybe this is getting too advanced. Still if there is any interest in discussing it we can integrate it at some point in the workshop.

@Leticia-maria
Copy link
Collaborator

Leticia-maria commented Sep 3, 2024

I added subtopics and more detailed description:

  1. Introduction to Julia
  • Why Julia?

    • Overview of Julia’s key features: speed, ease of use, and suitability for scientific computing.
    • Comparison with other languages like Python and MATLAB in terms of performance and syntax.
  • Setting Up a Julia Environment:

    • Step-by-step guide to setting up Julia in different environments:
    • VSCode: Installing the Julia extension and configuring the workspace.
    • Jupyter Notebooks: Setting up Julia kernels for interactive computing.
    • REPL: Introduction to Julia’s command-line interface for quick tests and explorations.
  1. Julia Syntax Essentials
  • Core Syntax:
    • Functions: Defining and calling functions, using multiple return values.
    • Loops & Conditionals: Understanding control flow with for, while, if, and else.
    • Variables & Types: Introduction to Julia’s type system, variable scope, and immutability.
    • Structs: Creating custom types with struct for more complex data structures.
    • Broadcasting: Efficiently applying functions across arrays and other collections.
    • Unicode Characters: Using Unicode for clearer and more readable code.
    • File I/O: Basics of reading from and writing to files.
  1. Leveraging Julia’s Power
  • Multiple Dispatch:
    • Explanation of Julia’s unique multiple dispatch system, with examples to showcase its flexibility and performance benefits.
  • Package Manager (Pkg):
    • Introduction to managing Julia packages: adding, updating, and removing packages.
    • Quick look at useful development tools provided by the package manager.
  1. Working with Numerical Data
  • Key Packages:

    • LinearAlgebra: Essential functions for matrix operations and linear algebra.
    • DataFrames: Handling tabular data, similar to pandas in Python.
    • Unitful: Managing physical units in calculations to avoid errors.
    • Distributions: Working with statistical distributions for simulations and data analysis.
  • Plotting:

    • Introduction to plotting in Julia using Plots.jl, with examples of common plots.
  1. Benchmarking and Optimizing Code
  • BenchmarkTools.jl: How to measure code performance accurately.
  • Array Views & Memory Allocations: Techniques to reduce memory usage and improve performance.
  • Type Stability: Understanding and ensuring type stability for faster execution.
  1. Advanced Topics
  • Basic Parallelization:
    • Introduction to multi-threading in Julia, with simple examples to parallelize loops and tasks.
  • Basic GPU Programming:
    • Overview of high-level interfaces for GPU computing, making it accessible without deep GPU programming knowledge.
  • AutoDiff:
    • Brief introduction to automatic differentiation using FastDifferentiation.jl for optimization and machine learning applications.
  1. Conclusion & Next Steps
  • What to Expect in the Next Workshop:
    • Teasers of more advanced topics like Molecular Dynamics (using Molly) and Density Functional Theory (using DFTK).

@rkurchin
Copy link
Contributor

rkurchin commented Sep 3, 2024

This looks like an awesome overall outline to me! A few addenda:

  1. After the multiple dispatch section, I would add some content specifically talking about Julian interfaces, since that's quite important to understand things like AtomsBase, which will be focused on in the remainder of the workshop.
  2. Building on @cortner's suggestion, I do think it would be nice to talk about some of the more "workhorse" AD tools ("traditional" forward/reverse tools like ForwardDiff/Zygote and also slightly newer – but getting mature – tools like Enzyme) and also the power of Julian interfaces via things like ChainRules and AbstractDifferentiation in that context. Obviously the depth of this depends a bit on both time and how comfortable you guys are teaching this stuff, but (and this relates to the teaser thing) since a lot of the demos the next day are packages that make use of these tools, I think they're important to mention, ideally also including how they're distinct from other frameworks like JAX, Torch, etc.
  3. A bit of a look somewhere (probably either in the syntax section and/or in benchmarking) into some of the metaprogramming tools might be nice too – one of the neat benefits of Julia being "Julia all the way down" 😉

Pinging @jgreener64, @mfherbst, @tjjarvinen if there are any particular topics you'd want to be sure Julia newbies see!

Next steps (and we can talk about this in more detail when we meet today) as I see them would be:

  1. Starting to break out who will teach what
  2. Building up some rough time estimates for each section and starting to flesh out content accordingly
  3. (a bit further out obviously) finding friends/labmates(/advisors? I will attempt to voluntell Jerry) to be guinea pigs 😈

@Leticia-maria
Copy link
Collaborator

Leticia-maria commented Sep 3, 2024

  • Leticia (@Leticia-maria)

    • Why Julia? (1)
    • Leveraging Julia’s Power (3)
    • Working with Numerical Data (4)
    • Autodiff
  • Ethan (@ejmeitz)

    • Set up Julia Environment (2)
    • Parallel CPU
    • GPU
    • Benchmarking (5)
    • Next steps (7)

@jgreener64
Copy link

Looks great! I wouldn't be too ambitious about the coverage of more advanced topics like AD or GPU though, given the time available. Maybe give a flavour and say that interested participants can chat to the Julia people around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants