<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Performance on Tyler Collins</title>
    <link>https://www.tk11br.ca/tags/performance/</link>
    <description>Recent content in Performance on Tyler Collins</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>2022-2026 Tyler Collins. Content licensed under CC BY-NC 4.0.</copyright>
    <lastBuildDate>Wed, 26 Mar 2025 12:00:00 -0400</lastBuildDate>
    <atom:link href="https://www.tk11br.ca/tags/performance/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Revisiting Cython: Is It Still Effective?</title>
      <link>https://www.tk11br.ca/posts/revisiting-cython/</link>
      <pubDate>Wed, 26 Mar 2025 12:00:00 -0400</pubDate>
      <guid>https://www.tk11br.ca/posts/revisiting-cython/</guid>
      <description>A 2025 reassessment of Cython&amp;#39;s performance, workflow, and place beside modern Python libraries and compilers.</description>
      <content:encoded><![CDATA[<p>I first presented Cython in 2020. Five years and several major releases later, I wanted to see whether that old advice still held up.</p>
<p>This talk looked at what changed in Cython, whether it got faster, and whether it became any easier to use. I worked through a few demo problems and compared the results with modern Python and its performance libraries.</p>
<iframe src="https://www.youtube.com/embed/n-T_8dSqd-s" title="Revisiting Cython: Is It Still Effective?" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<h2 id="abstract">Abstract</h2>
<p>Python is often praised for its speed of development but criticized for its execution speed. However, this has changed significantly in recent years due to major improvements in both Python itself and its most popular libraries. Libraries such as TensorFlow, OpenCV, NumPy, and Pandas all use a tool called Cython. Cython is an extension of Python that allows functions to be compiled into C or C++, mitigating Python&rsquo;s performance limitations.</p>
<p>Since the <a href="https://youtu.be/y6bKDKFavPA">last webinar on this package in 2020</a>, several major versions have been released. This talk will explore what has changed, whether performance has improved, and if development has become easier. During the webinar, a few demo problems will be explored live. Experience with Python is expected, while familiarity with C/C++ and Jupyter notebooks will be helpful.</p>
<p>The <a href="https://explora.alliancecan.ca/events/co-colloquium-revisiting-cython-is-it-still-effective">event page</a> has the event details.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Diagnosing Wasted Resources from User-Facing Portals</title>
      <link>https://www.tk11br.ca/posts/diagnosing-wasted-resources/</link>
      <pubDate>Wed, 14 Aug 2024 12:00:00 -0400</pubDate>
      <guid>https://www.tk11br.ca/posts/diagnosing-wasted-resources/</guid>
      <description>A walkthrough of using national cluster portals to investigate wait times, priority, and wasted CPU, memory, and GPU allocations.</description>
      <content:encoded><![CDATA[<p>A slow job and a slow queue are different problems. This talk was about using the national cluster portals to figure out which one you&rsquo;re dealing with.</p>
<p>I covered job history, account priority, wait times, and resource-use reports. The examples looked at CPU, memory, and GPU requests that did not match the work being done. The point was to check the evidence before changing a job request.</p>
<iframe src="https://www.youtube.com/embed/RQaXX2yrED0" title="Diagnosing Wasted Resources from User-Facing Portals on the National Clusters" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<h2 id="abstract">Abstract</h2>
<p>Researchers often leave resources on the table when specifying their job requirements on the national systems. This talk builds on previous sessions and uses the Digital Research Alliance of Canada&rsquo;s User Facing Portals to explore what different types of jobs look like when they waste resources. Demonstrations will include interactive jobs, parallel jobs, GPU workflows, and more. With more accurate job specifications, researchers can expect shorter wait times and more throughput on any general-purpose system.</p>
<p><a href="https://helpwiki.sharcnet.ca/wiki/images/9/9e/DiagnosingWaste.pdf">Download the slides</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Modern Approaches to Profiling in Python with Scalene</title>
      <link>https://www.tk11br.ca/posts/scalene/</link>
      <pubDate>Wed, 03 May 2023 12:00:00 -0400</pubDate>
      <guid>https://www.tk11br.ca/posts/scalene/</guid>
      <description>A practical introduction to profiling Python CPU, memory, and GPU use with Scalene on HPC systems.</description>
      <content:encoded><![CDATA[<p>Before rewriting slow Python or moving it into Cython, it helps to find out what is actually slow.</p>
<p>This Compute Ontario Colloquium was an introduction to <a href="https://github.com/plasma-umass/scalene">Scalene</a>. Scalene separates time spent in Python from time spent in native libraries, and it can also profile memory and GPU use. I ran it on the Alliance systems from a Jupyter notebook, then compared native Python, vectorized code, Cython, and just-in-time compilation.</p>
<iframe src="https://www.youtube.com/embed/Uq60vknROcM" title="Modern Approaches to Profiling in Python with Scalene" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<h2 id="abstract">Abstract</h2>
<p>Python is a language developers choose to write in for convenience rather than speed. However, speed can be recovered by offloading calculations to libraries which leverage lower-level languages like NumPy, Cython, and more. Scalene is a high-performance CPU, GPU, and memory profiler which can illustrate where code should be passing calculations to other libraries for significant increases in speed. Scalene also includes support for Jupyter Notebooks, OpenAI suggestions for vectorizing code, as well as a significantly lower overhead and higher accuracy than other profilers. This talk will introduce the concepts required for understanding why external libraries are faster than native Python, interactions with approaches such as Cython and just-in-time compilers, as well as a live demonstration of Scalene on the Alliance systems inside of a Jupyter Notebook. Familiarity with Python, virtual environments, and Jupyter notebooks will be assumed.</p>
<p>The <a href="https://github.com/Andesha/sharcnet-scalene">slides, notebooks, and examples are available on GitHub</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Cython: A First Look</title>
      <link>https://www.tk11br.ca/posts/cython/</link>
      <pubDate>Sun, 20 Mar 2022 14:40:38 -0400</pubDate>
      <guid>https://www.tk11br.ca/posts/cython/</guid>
      <description>A first look at using Cython to recover performance when Python code needs to run faster.</description>
      <content:encoded><![CDATA[<p>Back when I first got hired at SHARCNET, I used a lot of Python. I mean a lot. This meant I quickly became the lightning rod for all Python-related questions and commentary.</p>
<p>During a fun Friday chat, a colleague remarked that Python was, on average, 40x slower than C++. I defended my current language of choice, saying it was better than that, surely. To make a long story short, I was wrong. It really is about 40x slower depending on the problem. Determined to prove myself capable, and my language of choice a bit more defensible, I decided to look into ways to make Python faster.</p>
<p>I eventually landed on Cython. It turns out the best way to make Python faster was to use as much C++ as possible.</p>
<p>Below is my abstract for the talk as well as the recording:</p>
<iframe src="https://www.youtube.com/embed/y6bKDKFavPA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p>&ldquo;Often we write programs in Python for convenience, not for speed. When work becomes elevated to High Performance Computing (HPC) environments, speed once again becomes a concern. Cython is an extension of Python which allows functions to be compiled as C (or C++) and recover the significant performance trade-offs of Python. Cython achieves this by supporting calling C functions, declaring of type information, as well as providing access to C++ STL functionality. Popular packages and libraries that take advantage of Cython include: TensorFlow, OpenCV, NumPy, Pandas, and more. This webinar will cover a basic introduction to Cython, a demo translating vanilla Python into Cython, followed by a short demo of how to run Cython in our own Compute Canada HPC environments. Experience with Python will be expected, while familiarity with C/C++ and Jupyter notebooks will be helpful. Webinar material and code will be made available on GitHub for reference.&rdquo;</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
