OpenMythosのサンプルプログラムを動かしました

1.概要 前回、OpenMythosの環境構築まで実現したので、GitHubにあるサンプルプログラム(Usage)を動かしてみました。一部エラーが発生しましたが、結果出力部分なので修正をしました。その内容を記述します。 2.詳細 Usageに記載されているPythonプログラムをopenmythos_usage.pyとして作成します。 $ source ~/mypy/bin/activate (mypy) $ pythoh3 openmythos_usage.py 下記エラーとなります [MLA] Parameters: 1,538,626 [MLA] Logits shape: torch.Size([2, 16, 1000]) [MLA] Generated shape: torch.Size([2, 24]) Traceback (most recent call last):   File "/home/nakasima/openmythos/openmythos_usage.py", line 48, in <module>     rho = torch.linalg.eigvals(A).abs().max().item()           ^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: linalg.eig: The input tensor A must have at least 2 dimensions. コードの下記部分を修正します #rho = torch.linalg.eigvals(A).abs().max().item() rho = A.abs().max().item() $ source ~/mypy/bin/activate (mypy) $ pythoh3 openmythos_usage.py [MLA] Parameters: 1,538,626 [MLA] Logits shape: torch.Size([2, 16, 1000]) [MLA] Generated shape: torch.Size([2, 24]) [MLA] Spectral radius ρ(A) = 0.3679 (mus...

ubuntuのshutdownに必要な時間を短縮したい

1.概要

稀に、ubuntuのshutdownに時間が必要な場合があります。長い間、対処方法がわかなかったのですが、原因の調査方法と対処方法に関して記載します。

2.詳細

(1) gurbパラメータ変更
起動や停止にログをコンソールに表示できるようにするために、quiet splashを削除します。
/etc/default/grub の10行目の記述を変更します。
"quiet splash"  ==>  ""  へ変更
sudo update-grub

(2) shutdownが遅い理由
上記状態にして利用していると、shutdown時に下記処理で約90秒止まっていることがわかりました。
[ ***   ] A stop job is running for Unattended Upgrades Shutdown (10s / 30 min)

(3) 最初の対応
90秒の待ち時間を短縮する方式をネットで見つけて設定しました。
/etc/systemd/system.conf のDefaultTimeoutStopSecを設定します。
DefaultTimeoutStopSec=10s
上記設定をしても10秒間待つことがたまに発生していました。

(4) Unattended Upgradesの停止
ubuntuは自動アップグレードを実行しているようで、これを止めることができます。
sudo dpkg-reconfigure unattended-upgrades
ubuntuのアップグレードは自分で定期的に実行しているので、この運用に変更しました。

参考
[外部サイト参照]
【備忘録】Ubuntu Server 20.04LTSのシャットダウンがクソ遅い
【備忘録】apt-get upgradeでロックされてるエラー
How To Disable Unattended Upgrades On Ubuntu

コメント

このブログの人気の投稿

miniPCのBMAXでWindows11のsecure boot設定漏れでトラブル発生

LinuxMint-22.3にWine 11.6をサクッと入れてみました

LinuxMint 21.3にWinBoat導入を試してみました