This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This isn't supposed to run as a bash script, i named it with ".sh" for syntax highlighting. | |
| # https://developer.nvidia.com/nsight-systems | |
| # https://docs.nvidia.com/nsight-systems/profiling/index.html | |
| # My preferred nsys (command line executable used to create profiles) commands | |
| # | |
| # In your script, write | |
| # torch.cuda.nvtx.range_push("region name") | |
| # ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TYPE job_status AS ENUM ('pending', 'in_progress', 'done', 'failed'); | |
| CREATE TABLE jobs ( | |
| id SERIAL PRIMARY KEY, | |
| status job_status NOT NULL DEFAULT 'pending', | |
| payload JSONB, | |
| created_at TIMESTAMP DEFAULT now(), | |
| updated_at TIMESTAMP DEFAULT now(), | |
| visible_at TIMESTAMP DEFAULT now(), -- SQS visibility timeout | |
| retry_count INT DEFAULT 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [package] | |
| name = "uploader" | |
| version = "0.1.0" | |
| edition = "2021" | |
| [dependencies] | |
| anyhow = "1.0.86" | |
| clap = { version = "4.5.13", features = ["derive"] } | |
| futures = "0.3.30" | |
| reqwest = { version = "0.12.5", features = ["multipart", "stream"] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use axum::{ | |
| extract::ws::{Message, WebSocket, WebSocketUpgrade}, | |
| response::IntoResponse, | |
| routing::get, | |
| Router, | |
| }; | |
| use test_websockets::ClientMessage; | |
| use tracing::{debug, error, info}; | |
| use std::net::SocketAddr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use flume; | |
| use futures::future::join_all; | |
| use futures::stream::iter; | |
| use futures_util::stream::FuturesUnordered; | |
| use futures_util::{SinkExt, StreamExt}; | |
| use std::borrow::Cow; | |
| use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; | |
| use test_websockets::ClientMessage; | |
| use tokio::fs::OpenOptions; | |
| use tokio::io::{AsyncWriteExt, BufWriter}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #![feature(array_chunks)] | |
| use std::mem; | |
| use std::time::Duration; | |
| use anyhow::Result; | |
| use bytes::Bytes; | |
| use futures::{stream, StreamExt}; | |
| use reqwest::{self, Client}; | |
| use serde::Serialize; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use rand::Rng; | |
| use std::time::Instant; | |
| const N: usize = 1_000_000; | |
| const N_WARMUP: usize = 100; | |
| struct Shapes { | |
| rectangles: Vec<Rectangle>, | |
| triangles: Vec<Triangle>, | |
| squares: Vec<Square>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::time::Instant; | |
| use rand::Rng; | |
| const N_WARMUP: usize = 100; | |
| static SHAPES_COEFF: [f32; 3] = [1.0, 1.0, 0.5]; | |
| const N: usize = 1_000_000; | |
| #[derive(Clone, Copy)] | |
| enum Type { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::time::Instant; | |
| const N: usize = 10000; | |
| #[derive(Clone, Copy)] | |
| enum Shape { | |
| Rectangle(Rectangle), | |
| Triangle(Triangle), | |
| Square(Square), | |
| Init, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use rand::Rng; | |
| use std::time::Instant; | |
| const N: usize = 1_000_000; | |
| const N_WARMUP: usize = 100; | |
| enum Type { | |
| Rectangle, | |
| Square, | |
| Triangle, |
NewerOlder