Daily Edition · Page 4

THE DAILY INDEX

Technology, AI, software, security, crypto and business

GENERAL

TLDR Dev

THE BUG THAT TAUGHT ME MORE ABOUT PYTORCH THAN YEARS OF USING IT

This dev discovered a niche PyTorch bug while working on a sparse autoencoder, where the training loss plateaued due to the encoder weights failing to update on the Apple Silicon GPU (MPS). The root cause was traced to some of the Adam optimizer's operations silently failing to update output tensors on MPS due to the way memory was handled. A workaround was implemented by creating a contiguous temporary tensor, performing the operation, and then copying the results back to the original non-contiguous tensor.

DIRECTIVES AND THE PLATFORM BOUNDARY

There is an increasing trend of JavaScript frameworks introducing custom directives, such as `use client` and `use server`, which resemble language features but lack standardization. These directives can cause confusion, complicate debugging, and reduce portability by blurring the line between the JavaScript platform and specific frameworks. Explicit APIs with imports give better provenance, versioning, and tooling ergonomics compared to directives that end up working as platform “lock-in.”

HOW WE SAVED $500,000 PER YEAR BY ROLLING OUR OWN “S3”

Nanit reduced costs by creating N3, a Rust-based in-memory landing zone for video processing, using S3 as a fallback buffer. This removed PutObject request fees and short-term storage costs associated with S3's minimum storage duration. The solution uses a two-tier fallback system, where an N3-Proxy initially redirects uploads to S3 upon N3-Storage failure, and Camera Service then completely switches to S3 presigned URLs in case of broader N3 issues.

THE JOURNEY BEFORE MAIN()

This article explains the journey from when the OS kernel is asked to run a program to when the `main()` function is executed. The kernel uses the `execve` system call to load the program, which is usually in ELF format on Linux. The ELF file contains code, data, and other information, including an entry point where execution begins.  The kernel sets up the stack with arguments, environment variables, and auxiliary vectors before jumping to the `_start` function, which then initializes the language runtime and calls the user's `main()` function.

TLDR IndexPage 4