微軟 Phi-2 model 的授權改成 MIT License

Hacker News 的「Microsoft Phi-2 model changes licence to MIT (huggingface.co)」這邊看到的消息,連結是改成 MIT License 的 commit:「Upload 3 files · microsoft/phi-2 at 7e10f3e」。

看了一下 model 的參數是 2.7B,宣稱在 13B 以下 model 中是前段班:

Phi-2 showcased a nearly state-of-the-art performance among models with less than 13 billion parameters.

再回頭查一下這段宣稱的時間,當初發表的時間是 2023/12/12:「Phi-2: The surprising power of small language models」。

應該是希望在行動裝置上用更少的運算量達到效果...

另外找了一下 GGUF 格式,看起來 TheBloke/phi-2-GGUF 這邊已經有轉好的了,可以直接上 llama.cpp 跑。

LLVM 的更換授權進展

Hacker News Daily 上看到「LLVM relicensing update & call for help」這篇,在講 LLVM 計畫從 UIUC licenseMIT license 授權轉成 Apache License 2.0 的進展,在 Hacker News 上的討論「LLVM relicensing update and call for help (llvm.org)」也可以翻一下。

目前的規劃是這樣:

文章開頭還是先花了一些篇幅解釋,這個計畫主要是要處理專利的問題,原先的 developer policy 對於專利的句子太粗糙,會授權過多的權力給 LLVM。這對於一般個人可能影響不大,但對於手上有一卡車專利的公司來說就不太願意了。

另外一個問題是 LLVM 遇到的問題,因為 runtime library 的部份是用 UIUC license + MIT license 授權,但主體是用 UIUC license 授權,這使得主體的程式碼不能隨意搬到 runtime library 裡面:

The run time libraries were dual licensed under the UIUC and MIT license; the rest of the code only under the UIUC license. Therefore, we could not easily move code to run time libraries from other parts. The reason run time libraries were dual licensed was to enable linking to run time library binaries without requiring attribution to LLVM.

因為這些目標,所以新的授權會是 Apache License 2.0 為主,裡面有設計還算合理的專利授權條件,另外大家也算熟悉,再來是針對 object code 以及 GPLv2 設計了例外條款:

As an exception, if, as a result of your compiling your source code, portions of this Software are embedded into an Object form of such source code, you may redistribute such embedded portions in such Object form without complying with the conditions of Sections 4(a), 4(b) and 4(d) of the License.

In addition, if you combine or link compiled forms of this Software with software that is licensed under the GPLv2 ("Combined Software") and if a court of competent jurisdiction determines that the patent provision (Section 3), the indemnity provision (Section 9) or other Section of the License conflicts with the conditions of the GPLv2, you may retroactively and prospectively choose to deem waived or otherwise exclude such Section(s) of the License, but only in their entirety and only with respect to the Combined Software.

在「Long tail of individuals and corporations without a relicensing agreement yet」這邊有目前還沒有同意重新授權的人以及團隊的資料,看起來不會是每個人都願意重新授權,到時候可能還得再挑出來重寫,但有些可以獨立出來的可能可以維持,畢竟 UIUC licesne 與 MIT license 都是 permissive license,只要放到另外一個目錄下,大家知道不是 Apache License 2.0 就還好...

在一台電腦上多畫面與多鍵盤滑鼠操作遊戲:Universal Split Screen

Hacker News Daily 上看到這款工具,可以在 Windows 上把拆出多個畫面,並且提供給不同的鍵盤與滑鼠使用:「Universal Split Screen」,而且是 open source 專案 (使用 MIT License),程式碼在 UniversalSplitScreen/UniversalSplitScreen 這邊。

理論上只要不是太吃資源的遊戲,應該都適合這個方法搞 (從他列出來的遊戲列表看起來,似乎都不會太吃 CPU 與顯卡)。

另外在想是不是也可以拿給其他用途使用,像是 PuTTY 之類的程式?

第五堂:「Command-line Environment」

這個系列是從『MIT 的「The Missing Semester of Your CS Education」』這邊延伸出來的,這邊講的是「Command-line Environment」這篇。

開始聊之前先看一下其他的東西,我注意到這系列文章有簡體中文 (這裡,已經翻完) 與繁體中文 (這裡,還有幾篇還沒翻完) 的版本了,如果讀英文會比較累的人可以參考看看。

這堂講 command line 下的各種事情,感覺起來比起前面硬不少。

首先就先開始講 signal,各家系統的 signal 應該還是有些微差異,可以參考各家的 signal(7) (在 command line 下用 man 7 signal 可以列出來)。

這邊講的 signal 都比較通用,像是 SIGKILL 的殺傷力,SIGTERMSIGQUIT,然後有提到 SIGHUP,但 SIGHUP 的設計慣例是拿來重讀設定檔好像就沒提到了...

接下來就帶過 tmux,只大概講了一下概念 (sessions、windows、panes) 與用法。

然後講 shell 的 alias 對於打造環境的幫助,以及 dotfiles 的設計。

後面講 SSH 的應用,然後還提到了兩個不同方向的 port forwarding。

這些對於初學者來說應該蠻有幫助的,第一次打造自己的 shell environment 的過程應該還蠻有趣的?(已經是很久前了...)

第四堂:「Data Wrangling」

有陣子沒寫了,來還個債...

這個系列是從『MIT 的「The Missing Semester of Your CS Education」』這邊延伸出來的,這邊講的是「Data Wrangling」這篇。

這篇是在講 pipe 的用法,在講這些工具之前,其實有個很重要的概念應該要說明 (但沒有在這篇文章裡被提到),也就是 Unix philosophy,這個哲學是指 unix 環境下的工具,都會設計成只做好一件事情。

而要怎麼把這些工具串起來,最常見的就是 pipe,你可以在文章裡看到 grepsedsort 這些工具的用法,以及怎麼用 pipe 串起來。

這邊剛好也可以提一下,利用 pipe 可以把不同功能打散到不同的 process 上,剛好也可以稍微利用到現在常見的多 CPU 的環境。

另外上面因為提到了 grep,文章內花了不少篇幅在講 Regular expression 這個在 CS 課程裡面也是重要的基礎。

會放這種篇幅長度,一方面是 Regular expression 的實用性很高,另外一方面,學術上與自動機理論中的 DFANFA 都有關,算是學習計算理論的起點:

然後後面就有提到 AWK 這個工具,這邊要注意的是,雖然可以用 Perl 之類的工具作到類似的事情 (而且更強大),但 AWK 有被放到 POSIX 標準裡,所以在各種作業系統內幾乎都一定會出現,加上語法算是簡單,學起來還是很有幫助...

然後再最後面的段落冒出一個 gnuplot 畫個圖,以及示範 xargs 這種神器要怎麼用 (這邊會更建議看一下 manpage,可以配合 find 之類的工具用,並且平行化同時處理)。

然後最後示範了 binary data 怎麼處理。

MIT 終止與 Elsevier 的合約

美國在今年有不少學校開始跟進,終止與 Elsevier 的合約了。

首先是去年 (2019) 三月加州大學系統宣佈不跟 Elsevier 續約 (參考當時寫的「加州大學宣佈不與 Elsevier 續約」這篇),今年四月則是北卡大學系統宣佈不續約:「Upcoming Elsevier Cancellations」,以及紐約大學系統也宣佈不續約:「State University of New York Steps Away From the “Big Deal” with Elsevier」。

到這邊看到的消息主要都是公立學校系統在開槍,直到前幾天 MIT 也放新聞稿開槍宣佈不續約了,這應該是第一個頂級的私校開槍的消息:「MIT, guided by open access principles, ends Elsevier negotiations」。

維基機百科上查資料的時候,發現台灣在 2016 年底 CONCERT 就宣佈放掉 Elsevier 了,當時有發稿出來:「關於 Elsevier 資料庫合約談判 CONCERT 聲明」。

In Taiwan more than 75% of universities, including the region's top 11 institutions, have joined a collective boycott against Elsevier. On 7 December 2016, the Taiwanese consortium, CONCERT, which represents more than 140 institutions, announced it would not renew its contract with Elsevier.

微軟開源 1983 年版的 GW-BASIC

微軟用 MIT License 放出 1983 年版的 GW-BASIC:「Microsoft Open-Sources GW-BASIC」。

這次放出來程式看起來是 x86 assembly,不過放出來的版本好像也不能算是「原始」的版本,而是從 "master implementation" 轉譯出來的版本:

This source was ‘translated’?

Each of the assembly source files contains a header stating This translation created 10-Feb-83 by Version 4.3

Since the Instruction Set Architecture (ISA) of the early processors used in home and personal computers weren’t spectacularly different from one another, Microsoft was able to generate a substantial amount of the code for a port from the sources of a master implementation. (Alas, sorry, we’re unable to open-source the ISA translator.)

主要還是 PR,然後帶一些考古價值...

第三堂:「Editors (Vim)」

這個系列是從『MIT 的「The Missing Semester of Your CS Education」』這邊延伸出來的,這篇文章講第三堂課「Editors (Vim)」,這篇也是我決定要連載的原因 (身為 Vim 愛好者的偏好)。

這邊講的是 Vim 而不是標準的 vi (這個對於初學者應該不太容易遇到了),相較起來親民一些...

從基本的操作開始說,模式的切換,插入刪除移動類的與區塊選取類的都有提到。

比較特別的是他用黑板畫 Finite-state machine 來解釋不同的按鍵操作會切換到不同的模式,應該說這不愧是給 CS 學生上的課?

另外補充一下,用搜尋引擎搜一下 vim cheatsheet,沒事可以看一下 (回憶一下),算是蠻好用的。

第二堂:「Shell Tools and Scripting」

這個系列是從『MIT 的「The Missing Semester of Your CS Education」』這邊延伸出來的,這篇文章講第二堂課「Shell Tools and Scripting」。

這堂有點像是第一堂的延伸,在講更多 shell 的操作與工具,然後說明 shell script 怎麼寫。

開頭就先說明有 function,然後講了不少 magic variable,像是 $0$1$9,而 $@$# 也提到了 (但居然沒提到 $*),然後再來是 $$!!$_

然後提到 true 與 false,接著就講條件 || 與 && 了。後面就開始講 shell 裡面的 for 與 if,基本上到這邊已經能寫不少東西了?

後面就介紹更多工具...

第一堂:Course overview + the shell

這個系列是從『MIT 的「The Missing Semester of Your CS Education」』這邊延伸出來的,這篇文章講第一堂課「Course overview + the shell」。

前面大概講一下這 11 堂各一個小時的課大概是什麼,後面就開始講 shell 下的操作了。

先講了一些基本指令 (date & echo),然後提到了環境變數 $PATH,接著就講目錄結構與 ls,然後就順便提到 man 可以拿來查說明,接著是講 redirect 與 pipe 以及 root 權限的特殊性 (以及 sudo)。

在課程最後面的這個範例,你第一眼看不會想到是第一堂課就可以教完的東西,但的確是結合了上面提到的所有東西,可以細細品味一下:

$ echo 1 | sudo tee /sys/class/leds/input6::scrolllock/brightness