GithubHelp home page GithubHelp logo

jzarnett / ece459 Goto Github PK

View Code? Open in Web Editor NEW
417.0 20.0 133.0 711.72 MB

ECE 459: Programming for Performance

TeX 94.96% Makefile 0.11% Python 0.76% Shell 0.08% Rust 2.70% Cuda 0.09% C 0.88% C++ 0.08% Assembly 0.33% DTrace 0.01%

ece459's Introduction

ece459

ECE 459: Programming for Performance

ece459's People

Contributors

armcburney avatar baverbud avatar bhamodi avatar broehl avatar chjon avatar ckitagawa avatar cvarier avatar daltyboy11 avatar deadinsky avatar dongyuzheng avatar gbleaney avatar h365chen avatar jzarnett avatar k-yang avatar kennethsinder avatar mchlswyr avatar naqu6 avatar nathanielrn avatar optimisticpeach avatar patricklam avatar peter-dye avatar quantummaniac avatar sakshambajaj avatar szabado avatar tanatorn avatar theorangeone avatar trinovantes avatar viatsk avatar zacjoffe avatar zahin-mohammad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ece459's Issues

Rust lecture is a bit out of date

Hello! I'm enjoying the course so far. I was curious about what you would talk about when it came to Rust, so I looked a bit ahead. :)

Slide 29/38 in Lecture 35: Rust is out of date. It shows this example and says that it doesn't compile:

let mut s = String::from("one");
let r1 = &mut s;
let r2 = &mut s;

However, if you run this today, it will compile with no issues.

The reason for this is because about a year ago Rust added a feature called Non-Lexical Lifetimes (NLL). That makes it so that the lifetime of a reference is no longer only tied to the length of its scope. The lifetime is now tied to how long it is used (up to the end of its scope of course).

To make this code stop compiling, you have to mutate r1. This extends its lifetime to past the declaration of r2, which means that creating the mutable reference is r2 is now illegal.

let mut s = String::from("one");
let r1 = &mut s;
let r2 = &mut s;
// This line causes the code to stop compiling
r1.push_str(" two");

Some of the other slides also refer to references having to go out of scope in order for you to be able to create new &mut references. This is no longer 100% true because of NLL.

Some resources on NLL if you're interested:

Assignment 3 Timings

Assignment 3 gives some timings for 500 and 5000 points. Are these accurate, or should they be for 500 * 64 and 5000 * 64 points?

Missing closing bracket

https://github.com/jzarnett/ece459/blob/master/lectures/L22.tex#L187

( as the calculation of forces is called from the host, and such global functions can call device functions but not other global functions. Device functions can call only other device functions. So it makes it clear where the entry points are from host code. In some OOP-sense, you could consider the device functions to be ``private'', not that I encourage you to think that way.

L16 max in live-coding uses sketchy idiom

lectures/live-coding/L16/rayon-max-array/src/main.rs uses:

vec.par_iter().for_each(|n| {
    let mut previous_value = max.load(Ordering::SeqCst);
    if *n > previous_value {
        while max.compare_and_swap(previous_value, *n, Ordering::SeqCst) != previous_value {
            println!("Compare and swap was unsuccessful; retrying");
            previous_value = max.load(Ordering::SeqCst);
        }
    }
});

which may have a race condition between previous_value and the new max; the code in L16.tex uses a loop (as recommended) instead:

    loop {
        let old = max.load(Ordering::SeqCst);
        if *n <= old {
            break;
        }
        let returned = max.compare_and_swap(old, *n, Ordering::SeqCst);
        if returned == old {
            println!("Swapped {} for {}.", n, old);
            break;
        }
    }

Both code snippets were introduced in the same commit on October 14. Assigning to @jzarnett who wrote this code.

Lab 1 manual hyperfine command

The hyperfine command in lab 1 manual seems to be missing single quotes around the command to be benchmarked. I believe it should be hyperfine -i 'target/release/lab1 verify 100.txt'. I would open a pull request but the manual is only provided as a PDF.

typo in lecture 15

in the grouping requests section:
since the logic to build a a larger request is almost certainly significantly more complex than the logic to build a small request.

duplicate "a"

Lecture 23 (notes + slides) have limited titles

Lecture 23 covers GPU password cracking, reduced-resource computation, and software transactional memory, but the slides and notes are only called "GPU Password Cracking". It might be a good idea to expand the title like you've done for other lectures

Cheat sheet for performance tools

I think one of the big take-aways from this course is learning to use analysis tools. IMO, there are two parts to that:

  1. Knowing what tools exist
  2. Knowing how to use them

This course is very useful and I really believe it'll help me in my career. I was wondering if the teaching team would consider compiling a list (more details the better) that would consolidate and succinctly describe the tools that we've learned about. It would also serve as an invaluable resource to future students taking this course.

L12 spinlock code wrong comparison

Should be my_lock.compare_and_swap(false, true, Ordering::SeqCst) == true instead of my_lock.compare_and_swap(false, true, Ordering::SeqCst) == false

Thanks to the anonymous student who reported it on Piazza.

A bunch of L25 links have died

code env setup tutorial hard to follow

student feedback: "The coding environment setup tutorial could be more robust though as it took significant time at the beginning and was discouraging way to start."

Lecture 3: cache line != page

"As discussed, the CPU generates a memory address for a read or write operation. The address will be mapped to a page. Ideally, the page is found in the cache, because that would be faster. If the requested page is, in fact, in the cache, we call that a cache hit. If the page is not found in the cache, it is considered a cache miss. In case of a miss, we must load the page from memory, a comparatively slow operation. A page miss is also called a page fault."

Pages of virtual memory are 'cached' in page frames of physical main memory at page granularity, but that's done in software. The contents of physical main memory are in turn cached at line granularity by the L1/L2/... caches in hardware. I don't think that that's clear from this explanation, and calling a hardware cache miss a page fault is confusing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.