{"id":21018635,"url":"https://github.com/amruthapatil/nyu-microbenchmark","last_synced_at":"2026-05-06T14:31:27.022Z","repository":{"id":224278370,"uuid":"762887781","full_name":"AmruthaPatil/NYU-MicroBenchmark","owner":"AmruthaPatil","description":"Investigates the performance of computing the dot product in C and Python, using various implementations and optimizations.","archived":false,"fork":false,"pushed_at":"2024-03-09T20:11:27.000Z","size":420,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T00:36:59.207Z","etag":null,"topics":["cpp","cprogramming","microbenchmark","python"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmruthaPatil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-25T00:49:57.000Z","updated_at":"2024-03-09T20:10:14.000Z","dependencies_parsed_at":"2024-03-10T06:35:04.179Z","dependency_job_id":null,"html_url":"https://github.com/AmruthaPatil/NYU-MicroBenchmark","commit_stats":null,"previous_names":["amruthapatil/nyu-hpml","amruthapatil/nyu-highperfml","amruthapatil/nyu-highperformanceml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AmruthaPatil/NYU-MicroBenchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-MicroBenchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-MicroBenchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-MicroBenchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-MicroBenchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmruthaPatil","download_url":"https://codeload.github.com/AmruthaPatil/NYU-MicroBenchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-MicroBenchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32698091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cprogramming","microbenchmark","python"],"created_at":"2024-11-19T10:26:53.804Z","updated_at":"2026-05-06T14:31:27.000Z","avatar_url":"https://github.com/AmruthaPatil.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dot Product Microbenchmark Summary\n\nThis project investigates the performance of computing the dot product in C and Python, using various implementations and optimizations. The goal is to measure execution time, compute bandwidth and throughput, and compare the results across different implementations.\n\n## Introduction\n\nMicrobenchmarking is the process of measuring the performance of small units of code, such as individual functions, to identify areas for optimization and compare different algorithms or implementations. In high-performance machine learning, it helps optimize code, select efficient algorithms, evaluate hardware, and verify code correctness, playing a crucial role in enhancing performance.\n\n## Tasks\n\n### Computing Dot Product in C\n\n- Write a micro-benchmark in C to compute the dot product of two float arrays.\n- Measure execution time for N=1000000 and N=300000000.\n- Compute mean execution time and bandwidth.\n- Compile with gcc and execute on a suitable node.\n\n### Computing Dot Product with Unrolling\n\n- Perform the same microbenchmark with unrolling to potentially improve performance.\n\n### Computing Dot Product with MKL\n\n- Use MKL (Intel Math Kernel Library) to compute the dot product and compare performance with the C implementation.\n\n### Computing Dot Product in Python\n\n- Implement the microbenchmark in Python using numpy arrays.\n- Compare performance with the C implementations.\n\n### Computing Dot Product with numpy.dot\n\n- Use numpy's built-in dot product function and compare performance with the other implementations.\n\n## Run the code\n\nTo run the project, use the provided shell submit file.\n\n## Summary of My Results\n- Basic dot product in C, achieving 1.733 GFLOP/sec and 6.932 GB/sec bandwidth for N = 1000000.\n- Dot product with loop unrolling in C, improving performance to 5.465 GFLOP/sec and 21.859 GB/sec for N = 1000000.\n- Dot product using Intel MKL in C, further enhancing performance to 6.314 GFLOP/sec and 25.257 GB/sec for N = 1000000.\n- Basic dot product in Python with NumPy arrays, significantly lower performance at 0.004 GFLOP/sec and 1.655 GB/sec for N = 1000000.\n- Dot product using NumPy's dot function in Python, showing a substantial improvement to 6.104 GFLOP/sec and 2539.353 GB/sec for N = 1000000.\n\n## Observations\n- The C implementations generally outperform the Python implementations in terms of throughput and bandwidth, especially for larger values of N.\n- Loop unrolling and using Intel MKL significantly improve the performance of the dot product computation in C.\n- The performance of the basic Python implementation is much lower compared to C, highlighting the interpreted nature of Python and its inefficiency in numerical operations.\n- Utilizing NumPy's dot function greatly enhances performance in Python, achieving throughput and bandwidth closer to C implementations.\n\n## Inferences\n- The choice of programming language and optimization techniques can have a significant impact on the performance of numerical computations.\n- Utilizing specialized libraries like Intel MKL for C and NumPy for Python can lead to substantial performance improvements.\n- While Python offers ease of use, it comes with a performance trade-off compared to lower-level languages like C. However, this gap can be narrowed by using optimized libraries.\n- Benchmarking different implementations is essential for understanding their performance characteristics and making informed choices for specific applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famruthapatil%2Fnyu-microbenchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famruthapatil%2Fnyu-microbenchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famruthapatil%2Fnyu-microbenchmark/lists"}