Using HuggingFace Accelerate for mixed-precision training

Note: This post was originally written in 2021, but I have since updated it to reflect the latest changes in HuggingFace Accelerate (last update November 2025 using accelerate==1.11.0). For a grad course that recently concluded, the course project required me to train and evaluate a large number of models. Our school’s local SLURM cluster has new GPUs that support fp16, which meant I could take advantage of PyTorch’s Automatic Mixed Precision (AMP) training. And honestly, there is no reason not to use it: we get reduced memory usage, faster training, and all of this without virtually any loss in performance. ...

December 20, 2021 · 4 min · Kumar Abhishek

The "No-Space" Backup Solution (Streaming tar over SSH)

We recently got an email from our IT department that our workstation OSes will be getting upgraded from Ubuntu 18.04 MATE to Ubuntu 20.04 GNOME. As much as I love MATE and how lightweight it is (LinuxScoop makes wonderful OS overview videos), I also like the “visuals” of GNOME. My personal laptop already runs Ubuntu 20.04 GNOME, so I am excited to have it on my lab workstation as well. However, this OS upgrade also means that we have to backup our workstations since the drives will be wiped. Our research group has a generous storage space allocation on Compute Canada’s Cedar, so storage is not a big issue. The problem is: Cedar’s long-term storage space is a “tape-based backup system”, so there is a strict limit on the number of files we can store there. Therefore, the best strategy is to create tar archives of our data and store those on Cedar. ...

July 10, 2021 · 4 min · Kumar Abhishek

Acoustic Voxels: Computational Optimization of Modular Acoustic Filters

Acoustic filters are used to “produce a desired sound pitch or to attenuate undesired noise”, and find many applications in the real world, from wind instruments (e.g., flutes, trumpets, clarinets, etc.) and mufflers (e.g., engine noise muffler, acoustic earmuffs) to hearing aids. However, designing customized acoustic filters with specific properties remains a challenge, with the current approach(s) being “complicated and unintuitive” due to their iterative trail-and-error based process. While the design space for these acoustic filters has traditionally been limited to simple geometric shapes, the recent strides in additive manufacturing have enabled the fabrication of complex geometries, thus opening up new possibilities for the expanding the design space. Motivated by this, this paper presents Acoustic Voxels, a computational method for the design of acoustic filters, which relies on modular design based on a simple shape primitive (a hollow cube with circular holes on some or all of its faces) to build a complex assembly. Moreover, the modular design enables a “fast and accurate” estimation of a given assembly’s acoustic performance, which in turn allows for optimization of its structure to achieve desired filtering properties. While the paper provides detailed mathematical formulations of the proposed method, in the interest of brevity, the key details are presented in this summary. ...

November 30, 2020 · 5 min · Kumar Abhishek

Guided Exploration of Physically Valid Shapes for Furniture Design

The design of furniture consists of two major components: geometric modeling and physical validity of shapes. While advances in software for 3D modeling have made it easier for even inexperienced users to design shapes and thus make content creation easy, there is a disconnect between the geometric design and the physical functionality assessment. The typical workflow for a designer is to create a 3D model followed by validation using a physical simulator, and depending on the validation results, the designer re-iterates the whole process. This is tantamount to trial-and-error, making it a slow process, not to mention (a) the lack of any feedback to the designer specific to why the design failed and (b) the inherent limited exploration of novel shapes by encouraging designers to opt for standard geometric shapes only. While there have been previous work on suggestive modeling and interactive shape exploration, these works are limited in their feedback such as providing only a binary response about whether the design is valid or not, lack of informed exploration, etc. This paper proposes “a computational design framework for efficient and intuitive exploration” of physically valid furniture design shapes. In particular, the framework allows constrained modeling of nail-jointed furniture design of furniture using medium density fiberboard, and is constrained on 3 conditions: connectivity, durability, and stability. The paper describes the proposed method and the theoretical justifications in explicit detail, and we provide a brief summary of the key details here. ...

November 30, 2020 · 5 min · Kumar Abhishek

Hierarchical Edge Bundles: Visualization of Adjacency Relations in Hierarchical Data

Compound graphs, a frequently encountered type of data set, have a hierarchical tree structure with parent-child relations (‘inclusion’ relations) and non-hierarchical relations between leaf nodes (‘adjacency’ relations). Such datasets are common in software systems, social networks, and citation networks, amongst other scenarios. Visualizing these data sets is difficult because the addition of adjacency relations in any existing tree visualization method results in visual clutter. Moreover, using a generic visualization approach for these yields poor results too because of the difficulty of separating the inclusion and the adjacency relations. The existing methods for visualizing compound graphs and compound directed graphs (hereafter collectively referred to as compound (di)graphs) have numerous shortcomings, such as the inefficient usage of the available space (radial and balloon layout-based tree visualization techniques), the lack of flexibility (methods for drawing clustered graphs), inability to scale well for compound (di)graphs with large hierarchies (ArcTree-based visualization), unintuitive presentation (matrix view based methods), and excessive clutter because of several “extra routing nodes” introduced by binary splits (flow map layouts). Drawing inspiration from the management and routing of electrical and network cables, this paper presents hierarchical edge bundles for visualizing compound (di)graphs. It is a flexible and an intuitive technique that can be used in conjunction with existing tree visualization methods and reduces visual clutter when working with a high count of adjacency relations. ...

November 23, 2020 · 4 min · Kumar Abhishek