<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Writing on Qihang Dai</title><link>https://qihang-dai.github.io/posts/</link><description>Recent content in Writing on Qihang Dai</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 04 Apr 2023 15:55:54 -0700</lastBuildDate><atom:link href="https://qihang-dai.github.io/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>Systematically Fixing CUDA in Conda</title><link>https://qihang-dai.github.io/posts/condafixcuda/</link><pubDate>Tue, 04 Apr 2023 15:55:54 -0700</pubDate><guid>https://qihang-dai.github.io/posts/condafixcuda/</guid><description>&lt;h2 id="tldr"&gt;TLDR&lt;/h2&gt;&#10;&lt;p&gt;if &lt;code&gt;pip&lt;/code&gt; wont solved the problem, use &lt;code&gt;conda&lt;/code&gt;. if &lt;code&gt;conda&lt;/code&gt; wont work, use &lt;code&gt;conda --update-all&lt;/code&gt; to update all the packages, or &lt;code&gt;conda --force-reinstall&lt;/code&gt; to reinstall the package. No need to reboot the system, may need to restart the python kernel.&lt;/p&gt;&#10;&lt;p&gt;use the officially instructed command on &lt;a href="https://pytorch.org/get-started/locally/"&gt;Pytorch website&lt;/a&gt;. choose the right version of cuda and pytorch.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://qihang-dai.github.io/posts/image/condaFixcuda/1680660294694.png" alt="1680660294694"&gt;&lt;/p&gt;&#10;&lt;h2 id="sytematic-review"&gt;Sytematic Review&lt;/h2&gt;&#10;&lt;p&gt;Normally cuda is not available is caused by Pytorch and cuda version mismatch. If both are installed correctly and the newest version, the problem is caused by the package management system &lt;code&gt;pip&lt;/code&gt; or &lt;code&gt;conda&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>MIT 6.824 Lab 1: MapReduce 复盘</title><link>https://qihang-dai.github.io/posts/mapreduce/</link><pubDate>Sun, 05 Mar 2023 13:09:49 -0800</pubDate><guid>https://qihang-dai.github.io/posts/mapreduce/</guid><description>&lt;p&gt;总体花了一周，比较摸鱼。不管是视频还是论文看完总是有点模糊，最费时间和理解最深的还是写代码。&lt;/p&gt;&#10;&lt;p&gt;mapreduce的结构很简单，就实现三个模块： 分配任务的coordinator， 申请任务和处理任务的worker， 以及他俩之间通信用的rpc的消息结构。大体上是参考这个&lt;a href="https://github.com/Sorosliu1029/6.824"&gt;repo&lt;/a&gt;半抄理解。一开始花了很多时间看了好几个repo， 发现用RPC沟通有很多种写法，有的用channel有的只有锁， 有的只定义一个args reply有的定义了 requestArgs 和finishArgs， 有的把rpc传进函数参数进行修改而有的直接传rpc的property然后返回一个新的struct， 迷惑了一段时间，最后发现其实都是一样的，只是写法不同。&lt;/p&gt;&#10;&lt;h2 id="structure"&gt;Structure&lt;/h2&gt;&#10;&lt;p&gt;Map reduce: Given a set of files, run map for all of them to map the keys into the corresponding values like word count (generate for each occurence of word for (word, 1)). Then for each key in the kv list, hash the key into a number within the reduce jobs amount, and append that value into the array[key hashed]. Thus we would have a array where keys with same hash are append into a same sublist. Stores this hashed array into intermediate files. After all map is done, run reduce for all intermediate files to generate the final result, like sum the count for the same key. The reduce would sort the subarray first so he can get same key stay together, then do simple loop and count sum.&lt;/p&gt;</description></item><item><title>Building an Overwatch Queue Notifier</title><link>https://qihang-dai.github.io/posts/overwatchgamequeue/</link><pubDate>Sat, 11 Feb 2023 16:11:56 -0800</pubDate><guid>https://qihang-dai.github.io/posts/overwatchgamequeue/</guid><description>&lt;h2 id="motivation"&gt;Motivation&lt;/h2&gt;&#10;&lt;p&gt;Overwatch queueing is very annoying to me: sometimes it is extremely slow, and I want to leave my desk to do some workout or drown my head into a book. However I won&amp;rsquo;t be able to know when the queue is done if i am not continuously checking the screen. Someone like large streamers may choose to browser youtubes while waiting, or they can just leave the speaker playing sound that when the queue is done he can hear it, which is also a huge mind burden. As an FPS game you have to rely on the headphone to hear the location of enemy, so it would be tiring to plug in plug out your headphone while queue. I want to make a device that can notify me when the queue is done, so I can leave my desk and do other things. It could also serves as a good practice for python autmation.&lt;/p&gt;</description></item></channel></rss>