PART 0 Prerequisites (compilation, environment, cluster)
PART I System Diagnostics (Nsight Systems)
S0 Annotate the code (NVTX)
S1 Capture the trace
S1b nsys analyze and automatic reports
S2 Read visual patterns
Pytest is a powerful Python testing framework that is widely used for unit testing, integration testing, and functional testing. This guide will take you step by step from basic to advanced features of Pytest, providing a comprehensive understanding of its capabilities.
Content :
| #!/bin/bash | |
| # raspios.sh | |
| # Usage: | |
| # REPOSITORY=YOUR_DOCKER_HUB_REPOSITORY_type raspios image_file_url debian_release type date ARCH | |
| # or if img already exists this works too: | |
| # raspios.sh dummy debian_release type date ARCH | |
| # (Default is not to delete the image after download.) | |
| # e.g. | |
| # Example for arm64: | |
| # ./raspios.sh https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-06/2023-12-05-raspios-bookworm-arm64-lite.img.xz bookworm lite 2023-12-06 arm64 |
A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.
Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.
In most of deep learning projects, the training scripts always start with lines to load in data, which can easily take a handful minutes. Only after data ready can start testing my buggy code. It is so frustratingly often that I wait for ten minutes just to find I made a stupid typo, then I have to restart and wait for another ten minutes hoping no other typos are made.
In order to make my life easy, I devote lots of effort to reduce the overhead of I/O loading. Here I list some useful tricks I found and hope they also save you some time.
use Numpy Memmap to load array and say goodbye to HDF5.
I used to relay on HDF5 to read/write data, especially when loading only sub-part of all data. Yet that was before I realized how fast and charming Numpy Memmapfile is. In short, Memmapfile does not load in the whole array at open, and only later "lazily" load in the parts that are required for real operations.
Sometimes I may want to copy the full array to memory at once, as it makes later operations
tmux new - Create and attach to a new session.tmux new -s NAME_HERE - Create and attach to a new session named NAME_HERE.CTRL-b, d - Detach (i.e. exit) from the currently-opened tmux session (alternatively, tmux detach). Note, this means press and hold CTRL, press b, release both, press d.tmux ls - Show list of tmux sessions.tmux a - Attach to the previously-opened tmux session.tmux a -t NAME_HERE - Attach to the tmux session named NAME_HERE.CTRL-d - Delete (i.e. kill) currently-opened tmux session (alternatively tmux kill-session).CTRL-b, [ - Enter copy mode, and enable scrolling in currently-opened tmux session. Press q to exit.CTRL-b, " - Split window horizontally (i.e. split and add a pane below).| # Sample toolchain file for building for Windows from an Ubuntu Linux system. | |
| # | |
| # Typical usage: | |
| # *) install cross compiler: `sudo apt-get install mingw-w64` | |
| # *) cd build | |
| # *) cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake .. | |
| # This is free and unencumbered software released into the public domain. | |
| set(CMAKE_SYSTEM_NAME Windows) | |
| set(TOOLCHAIN_PREFIX x86_64-w64-mingw32) |