-
Notifications
You must be signed in to change notification settings - Fork 26
[RFC]: Expansion of Extended BLAS Routines with WebAssembly Implementation and Enhanced Data Handling #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@kgryte @Planeshifter Please review my proposal and provide your feedback. Thank you. |
Will you please also comment on my title for the proposal? |
@kgryte Do i have to change anything? |
@0PrashantYadav0 Thanks for opening this RFC. A few comments/questions:
|
We already have WebAssembly implementations for What we need to check (for the remaining ~86 routines):
As I explored the project, I noticed that there are no common dependencies between single- and double-precision routines. Beyond that, I chose to focus on single precision first due to the following reasons:
Examples include:
Operations like dot products, FFTs, and matrix multiplications with complex support are traditionally more complex. However, extended BLAS’s scalar/vector-style routines are typically simpler to adapt.
While I haven’t yet included this in my proposal, I’d be happy to add it if you recommend doing so. Here’s why we should consider higher-level
Thank you @kgryte for your feedback, i will add the change in my final proposal as well. |
@kgryte I added showcase project as well please review my showcase project. |
This is my final proposal please review. |
where should i put this project on, medium or large section? |
Hey, @0PrashantYadav0, a few comments:
|
Okay I will change these, thank you for feedback |
make few changes now. |
Uh oh!
There was an error while loading. Please reload this page.
Full Name
Prashant Kumar Yadav
University status
Yes
University name
Indian Institute of Information Technology, Lucknow (IIITL)
University program
Bachelor of Technology in Computer Science and Artificial Intelligence
Expected graduation
May 2027
Short biography
I am a second-year B.Tech student at IIITL, majoring in Computer Science and Artificial Intelligence. I actively participate in AXIOS—the technical society at IIITL—as a member of both the FOSS and Web wings.
Recently, I completed an internship at UBIQCURE, a medical startup in India, where I developed an admin panel and a homepage using React, Express, and Next.js while leading a team of four. This experience deepened my understanding of JavaScript and the deployment process.
I have also won a hackathon by building a Next.js app for a Web3 project. My journey in technology began in the 11th grade when I selected computer science as one of my subjects, and since then, my passion for coding and innovation has grown steadily.
Over the past two years at IIITL, I have taken courses in full stack development (with JavaScript), data structures, algorithms in C, object-oriented programming in Java, computer networks, and compiler design. More recently, I have developed a keen interest in DevOps and have learned Go, Docker, and Kubernetes, which I am eager to explore further.
Timezone
Indian Standard Time (UTC +5:30)
Contact details
Platform
Mac
Editor
VSCode, for its handy extensions, excellent Git support, and compatibility with various programming languages.
Programming experience
I began learning JavaScript and Python in high school and later pursued full stack development in college using a project-based learning approach. Some of my notable projects include:
More projects can be found on my portfolio site: prashantyadav.site.
JavaScript experience
I've used JavaScript in many different technologies. For backend development, I've worked with frameworks like Hono, Express, and Elysia—all JavaScript-based, also i worked in golang for backend development. On the frontend, I've learned React, Vite, and Next.js. Since full stack development in JavaScript was part of my college coursework, I'm very familiar with the JavaScript ecosystem.
As a fun project, I built an app using Bun and Hono, which turned out pretty cool. You can check it out here: Expense Tracking App.
What I love most about JavaScript is how simple and easy it is to understand and work with. It also has a vast collection of packages—you can find one for almost anything!
The one downside, in my experience, is that JavaScript isn’t always accurate with calculations and lacks type safety, which can lead to errors.
Still, I really enjoy working with JavaScript and love building with it!
Node.js experience
As I started learning JavaScript, I came across Node.js, and since then, it has been a constant part of my journey. Whether building vanilla JavaScript projects or developing backends, Node.js has always been helpful.
I've used Node.js for backend development with Express and have also worked with various Node.js libraries, such as fs (File System), path, and dotenv. Additionally, I’ve used many Node packages in my projects, making development much easier and more efficient.
C/Fortran experience
I completed my Data Structures and Design and Analysis of Algorithms courses in my first and second semesters, respectively, using C.
For my first-year college project, I built a Ticket Machine—a terminal-based tool that allows users to select tickets, choose optional add-ons, and generates a final receipt.
Interest in stdlib
While looking for a JavaScript library with strong mathematical support, I came across stdlib. I needed a math tool for a project, and as I explored more, I found everything I was looking for. It also offers many additional features that are really useful.
My favorite features include:
Mathematical tools
Matrix support and functions
Linear algebra package
Various statistical distributions
, like binomial distributionComplex number
supportAs I explored it further, I really liked the idea behind it and wanted to contribute. I found a few good first issues, opened some PRs, and started getting involved.
Version control
Yes
Contributions to stdlib
I started contributing by adding a C implementation for
stats/base/dists
. After opening PRs for several statistical distributions, I submitted a PR to add a C ndarray interface and refactor the implementation for thestats/base
package. Later, I also opened a PR to add a C ndarray interface and refactor the implementation for theblas/ext/base/*
package.After that, I submitted a PR for adding the base C implementation for LAPACK and another PR for adding
math/base/special/log1pf
, along with a few othermath/base/special
packages. Later, I opened some PRs to add WebAssembly implementation forblas/ext/base/*
and a PR for WebAssembly implementations instats/strided
.Here are all my merged PRs:
Merged PRs
Here are all my open PRs:
Open PRs
Stdlib Showcase :
JavaScript Neural Network Classifier with stdlib
I built this lightweight neural network classifier in pure JavaScript that works with the Iris dataset. Instead of using big ML frameworks, I implemented everything from scratch using stdlib's math functions.
The project features a simple feedforward network with one hidden layer that I trained using stochastic gradient descent. I added data normalization to improve accuracy and made sure it runs in both browsers and Node.js.
It was a fun challenge to create an efficient machine learning implementation without any heavyweight dependencies - just JavaScript and stdlib's excellent mathematical utilities!
Project Overview
The goal of this project is to enhance extended BLAS routines in the stdlib library by:
Detailed Implementation Steps
1. Update the Manifest File
In the
manifest.json
file of the WebAssembly package, update the source dependency to point to the upstream JavaScript package (which includes the C implementation):2. Generate WebAssembly Binaries
After creating the required scripts (common across most packages), run:
make clean-wasm PKGS_WASM_PATTERN="blas/ext/base/wasm/<package-name>"
This command will generate:
Ensure that the main.wat file includes the external Apache-2.0 license header.
3. Add REPL Files and Type Definitions
types
directory.4. Implement JavaScript APIs
Add JavaScript files in the
lib
directory for modules and routines. These files will serve as the main API for external use.5. Create Example Files
Develop example files for modules and routines that import functions from the
lib
directory. Test these examples using:make examples EXAMPLES_FILTER=".*/blas/ext/base/wasm/<package-name>/.*"
6. Create Benchmark Files
Develop benchmarks for each module and routine. To run all benchmarks, use:
make benchmark BENCHMARKS_FILTER=".*/blas/ext/base/wasm/<package-name>/.*"
7. Write Test Files
Develop tests that cover various strides, offsets, and behaviors, including external tests for both routines and module functions. Run tests with:
8. Create a README File
Provide clear descriptions and explanations for each method in the README file. Document the different function types, such as:
*.main()
and*.ndarray()
mod.main()
,mod.ndarray()
)Expected Outcome
Project Timeline
The project will be executed in three phases over a 12-week schedule:
Phase 1: Single Precision Extended BLAS Routines
blas/ext/base/sapxsumkbn
beforeblas/ext/base/sapxsum
).Phase 2: Double Precision Extended BLAS Routines
Phase 3: Expension of extended BLAS Routines and Refactoring
Why This Project?
The project is exciting because it combines low-level programming (C and WebAssembly) with high-level JavaScript to dramatically improve the performance and efficiency of numerical computing. BLAS routines are vital for scientific and engineering applications, and accelerating them with WebAssembly will benefit a broad developer community. My background in both open-source contributions and numerical computing uniquely positions me to contribute effectively to this project.
Qualifications
View my WebAssembly PRs for blas/ext/base
Prior Art
This project builds on similar initiatives in numerical computing:
Commitment
I plan to dedicate approximately 30 hours per week during GSoC, ensuring steady progress and timely completion:
I have no major scheduling conflicts and will maintain regular communication with my mentors and the community.
Related Issues
No response
Checklist
[RFC]:
and succinctly describes your proposal.The text was updated successfully, but these errors were encountered: