如何擊敗Python的問題

Following the previous article written about solving Python dependencies, we will take a look at the quality of software. This article will cover “inspections” of software stacks and will link a free dataset available on Kaggle. Even though the title says the quality of “machine learning software”, principles and ideas can be reused for inspecting any software quality.

在上一篇有關解決Python依賴關系的文章之后,我們將介紹軟件的質量。 本文將介紹軟件堆棧的“檢查”,并將鏈接Kaggle上可用的免費數據集。 即使標題說明了“機器學習軟件”的質量,也可以重用原理和思想來檢查任何軟件質量。

應用程序(軟件和硬件)堆棧 (Application (Software & Hardware) Stack)

Let’s consider a Python machine learning application. This application can use a machine learning library, such as TensorFlow. TensorFlow is in that case a direct dependency of the application and by installing it, the machine learning application is using directly TensorFlow and indirectly dependencies of TensorFlow. Examples of such indirect dependencies of our application can be NumPy or absl-py that are used by TensorFlow.

讓我們考慮一個Python機器學習應用程序。 該應用程序可以使用機器學習庫,例如TensorFlow 。 在這種情況下,TensorFlow是應用程序的直接依賴項,通過安裝它,機器學習應用程序將直接使用TensorFlow并間接使用TensorFlow依賴項。 我們應用程序的這種間接依賴關系的示例可以是TensorFlow使用的NumPy或absl-py 。

Our machine learning Python application and all the Python libraries run on top of a Python interpreter in some specific version. Moreover, they can use other additional native dependencies (provided by the operating system) such as glibc or CUDA (if running computations on GPU). To visualize this fact, let’s create a stack with all the items creating the application stack running on top of some hardware.

我們的機器學習Python應用程序和所有Python庫在某些特定版本的Python解釋器上運行。 此外,他們可以使用其他附加的本機依賴項(由操作系統提供),例如glibc或CUDA (如果在GPU上運行計算)。 為了形象化這一事實,讓我們創建一個堆棧,其中所有項都創建在某些硬件之上運行的應用程序堆棧。

Image for post
Abstract layers of an application stack.
應用程序堆棧的抽象層。

Note that an issue in any of the described layers causes that our Python application misbehaves, produces wrong output, produces runtime errors, or simply does not start at all.

請注意,任何描述的層中的問題都會導致我們的Python應用程序行為異常,產生錯誤的輸出,產生運行時錯誤,或者根本無法啟動。

Let’s try to identify any possible issues in the described stack by building the software and let’s have it running on our hardware. By doing so we can spot possible issues before pushing our application to a production environment or fine-tune the software so that we get the best possible out of our application on the hardware available.

讓我們嘗試通過構建軟件來確定所描述堆棧中的任何可能問題,并使其在我們的硬件上運行。 這樣,我們可以在將應用程序推送到生產環境之前發現可能的問題,或者對軟件進行微調,以便在可用硬件上充分利用應用程序。

按需軟件堆棧創建 (On-demand software stack creation)

If our application depends on a TensorFlow release starting version 2.0.0 (e.g. requirements on API offered by tensorflow>=2.0.0), we can test our application with different versions of TensorFlow up to the current 2.3.0 release available on PyPI to this date. The same can be applied to transitive dependencies of TensorFlow, e.g. absl-py, NumPy, or any other. A version change of any transitive dependency can be performed analogically to any other dependency in our software stack.

如果我們的應用程序依賴于2.0.0版本開始的TensorFlow版本(例如tensorflow>=2.0.0提供的API要求),我們可以使用不同版本的TensorFlow來測試我們的應用程序,直到PyPI上可用的當前2.3.0版本為止。 這個日期 。 這可以應用于TensorFlow的傳遞依賴項,例如absl-py , NumPy或任何其他。 任何傳遞依賴的版本更改都可以類似于我們軟件堆棧中的任何其他依賴進行。

依賴猴子 (Dependency Monkey)

Note one version change can completely change (or even invalidate) what dependencies in what versions will be present in the application stack considering the dependency graph and version range specifications of libraries present in the software stack. To create a pinned down list of packages in specific versions to be installed a resolver needs to be run in order to resolve packages and their version range requirements.

請注意,考慮到軟件堆棧中存在的庫的依賴關系圖和版本范圍規范,一個版本更改可以完全更改(甚至無效)應用程序堆棧中將存在哪些版本的依賴關系。 要創建要安裝的特定版本的軟件包的固定列表,需要運行解析器以解析軟件包及其版本范圍要求。

Do you remember the state space described in the first article of “How to beat Python’s pip” series? Dependency Monkey can in fact create the state space of all the possible software stacks that can be resolved respecting version range specifications. If the state space is too large to resovle in a reasonable time, it can be sampled.

您還記得“如何擊敗Python的點子”系列的第一篇文章中描述的狀態空間嗎? Dependency Monkey實際上可以創建所有可能的軟件堆棧的狀態空間,這些版本可以根據版本范圍規范進行解析。 如果狀態空間太大而無法在合理的時間內恢復狀態,則可以對其進行采樣。

Image for post
An interpolated score function for a state-space made when installing two dependencies “simplelib” and “anotherlib” in different versions (valid combinations of different versions installed together).
當在不同版本中安裝兩個依賴項“ simplelib”和“ anotherlib”(一起安裝的不同版本的有效組合)時,為狀態空間提供一個插值得分函數。

A component called “Dependency Monkey” is capable of creating different software stacks considering the dependency graph and version specifications of packages in the dependency graph. This all is done offline based on pre-computed results from Thoth’s solver runs (see the previous article from “How to beat Python’s pip” series). The results of solver runs are synced into Thoth’s database so that they are available in a query-able form. Doing so enables Dependency Monkey to resolve software stacks at a fast pace (see a YouTube video on optimizing Thoth’s resolver). Moreover, the underlying algorithm can consider Python packages published on different Python indices (besides PyPI, it can also use custom TensorFlow builds from an index such as the AICoE one). We will do a more in-depth explanation of Dependency Monkey in one of the upcoming articles. If you are too eager, feel free to browse its online documentation.

考慮到依賴關系圖和依賴關系圖中軟件包的版本規格,稱為“依賴關系猴子”的組件能夠創建不同的軟件堆棧。 所有這些都是根據Thoth的求解器運行的預先計算的結果脫機完成的(請參閱“ How to beat Python's pip”系列的上一篇文章) 。 求解器運行的結果將同步到Thoth的數據庫中,以便以可查詢的形式提供它們。 這樣做使Dependency Monkey能夠快速解決軟件堆棧的問題 (請參見有關優化Thoth解析器的YouTube視頻 )。 此外,底層算法可以考慮發布在不同Python索引上的Python包( 除了PyPI之外 ,它還可以使用來自諸如AICoE的索引的自定義TensorFlow構建 )。 我們將在后續文章之一中對Dependency Monkey做更深入的解釋。 如果您太渴望了,請隨時瀏覽其在線文檔 。

Amun API (Amun API)

Now, let’s utilize a service called “Amun”. This service was designed to accept a specification of the software stack and hardware and execute an application given the specification.

現在,讓我們利用一項名為“ Amun ”的服務。 該服務旨在接受軟件堆棧和硬件的規范,并根據給定的規范執行應用程序。

Amun is an OpenShift cluster native application, that utilizes OpenShift features (such as builds, container image registry, …) and Argo Workflows to run desired software on specific hardware using a specific software environment. The specification is accepted in a JSON format that is subsequently translated into respective steps that need to be done in order to test the given stack build and run.

Amun是一個OpenShift群集本機應用程序,它利用OpenShift功能(例如構建,容器映像注冊表等)和Argo Workflow在使用特定軟件環境的特定硬件上運行所需的軟件。 該規范以JSON格式接受,隨后將其轉換為需要執行的各個步驟,以測試給定的堆棧構建和運行。

A walkthrough on running Amun inspections to check the quality of software.
有關運行Amun檢查以檢查軟件質量的演練。

The video linked above shows how Amun inspections are run and how the knowledge created is aggregated using OpenShift, Argo workflows, and Ceph. You can see inspected different TensorFlow builds tensorflow , tensorflow-cpu , intel-tensorflow and a community builds of TensorFlow for AVX2 instruction set support available on the AICoE index.

上面鏈接的視頻顯示了如何運行Amun檢查以及如何使用OpenShift,Argo工作流程和Ceph匯總所創建的知識。 您可以在AICoE索引上看到經過檢查的不同TensorFlow構建tensorflowtensorflow-cpuintel-tensorflow和TensorFlow for AVX2指令集支持的社區構建 。

在Kaggle上的Thoth檢查數據集 (Thoth’s inspection dataset on Kaggle)

We (Red Hat) have produced multiple inspections as part of the project Thoth where we tested different TensorFlow releases and different TensorFlow builds.

我們(Red Hat)作為Thoth項目的一部分進行了多次檢查,在其中我們測試了不同的TensorFlow版本和不同的TensorFlow版本。

One such dataset is Thoth’s performance data set in version 1 on Kaggle. It’s consisting out of nearly 4000 files capturing information about inspection runs of TensorFlow stacks. A notebook published together with the dataset can help one exploring the dataset.

這樣的數據集就是在Kaggle的版本1中的Thoth的性能數據 。 它由近4000個文件組成,這些文件捕獲有關TensorFlow堆棧檢查運行的信息。 與數據集一起發布的筆記本可以幫助人們探索數據集。

An introduction to Thoth’s datasets available on Kaggle.
在Kaggle上可獲得Thoth數據集的簡介。

托特計劃 (Project Thoth)

Project Thoth is an application that aims to help Python developers. If you wish to be updated on any improvements and any progress we make in project Thoth, feel free to subscribe to our YouTube channel where we post updates as well as recordings from scrum demos.

Project Thoth是旨在幫助Python開發人員的應用程序。 如果您希望了解我們在Thoth項目中所做的任何改進和進展的最新信息,請隨時訂閱我們的YouTube頻道 ,我們在其中發布更新以及Scrum演示的錄音。

Stay tuned for any updates!

請隨時關注任何更新!

翻譯自: https://towardsdatascience.com/how-to-beat-pythons-pip-inspecting-the-quality-of-machine-learning-software-f1a028f0c42a

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/388418.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/388418.shtml
英文地址,請注明出處:http://en.pswp.cn/news/388418.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

KindEditor解決上傳視頻不能在手機端顯示的問題

KindEditor自帶的上傳視頻生成的HTML代碼為<embed>&#xff0c;在手機端并不支持。于是可以自己在控件里增加生成video標簽相關代碼。 參考https://www.jianshu.com/p/047198ffed92。。 然而對著修改后沒有成功&#xff0c;可能是那里沒有改對吧。依然生成的是<embed&…

湖北經濟學院的計算機是否強,graphics-ch11-真實感圖形繪制_湖北經濟學院:計算機圖形學_ppt_大學課件預覽_高等教育資訊網...

第十一章 真實感圖形技術1,簡單光照明模型2,多邊形繪制方法3,透明4,整體觀照明模型5,光線跟蹤算法第十章 真實感圖形繪制光照模型 (Illumination Model):計算某一點的光強度的模型11.1 真實感圖形的 特點? 能反映物體表面顏色和亮度的細微變化? 能表現物體表面的質感? 能通過…

ARP攻擊網絡上不去,可以進行mac地址綁定

紅色部分是需要敲的命令 Microsoft Windows [版本 6.1.7600] 版權所有 (c) 2009 Microsoft Corporation。保留所有權利。 C:\Users\dell>arp -s 顯示和修改地址解析協議(ARP)使用的“IP 到物理”地址轉換表。 ARP -s inet_addr eth_addr [if_addr] ARP -d inet_addr [if…

《獨家記憶》見面會高甜寵粉 張超現場解鎖隱藏技能

1月23日&#xff0c;由愛奇藝出品&#xff0c;小糖人聯合出品的沉浸式成長練愛劇《獨家記憶》在京舉行粉絲見面會。愛奇藝高級副總裁陳宏嘉&#xff0c;愛奇藝副總裁、自制劇開發中心總經理、《獨家記憶》總制片人戴瑩&#xff0c;小糖人董事長、《獨家記憶》總制片人朱振華&am…

計算機軟件技術基礎fifo算法,軟件技術基礎真題

一、填空1、數據結構按邏輯結構可分為兩大類&#xff0c;它們分別是線性和非線性2.1、在長為n的順序存儲的線性表中插入和刪除元素時所需移動元素的平均次數(等概率情況下)為&#xff1a;Einn/2&#xff0c;Ede(n-1)/22.2、順序表有5個元素&#xff0c;設在任何位置上插入元素是…

NOI 2016 優秀的拆分 (后綴數組+差分)

題目大意&#xff1a;給你一個字符串&#xff0c;求所有子串的所有優秀拆分總和&#xff0c;優秀的拆分被定義為一個字符串可以被拆分成4個子串&#xff0c;形如$AABB$&#xff0c;其中$AA$相同&#xff0c;$BB$相同&#xff0c;$AB$也可以相同 作為一道國賽題&#xff0c;95分…

多元線性回歸 python_Python中的多元線性回歸

多元線性回歸 pythonVideo Link影片連結 This episode expands on Implementing Simple Linear Regression In Python. We extend our simple linear regression model to include more variables.本集擴展了在Python中實現簡單線性回歸的方法 。 我們擴展了簡單的線性回歸模型…

關于apache和tomcat集群,線程是否占用實驗

測試目的&#xff1a; 測試在apache入口的時候進入&#xff0c;當Tomcat的一個請求陷入死循環&#xff0c;或者線程進入循環無反應的時候&#xff0c;是否此時占用apache的線程資源。 測試原因&#xff1a; 如果要是影響&#xff0c;無論tomcat線程設置成多大&#xff0c;都…

爬蟲之數據解析的三種方式

一&#xff0c;正則表達式解析 re正則就不寫了&#xff0c;前面已經寫入一篇很詳細的正則表達式模塊了~ 而且&#xff0c;在爬蟲中&#xff0c;下面兩種方式用的多一些~ 正則表達式&#xff1a;https://www.cnblogs.com/peng104/p/9619801.html 大致用法&#xff1a; pattern …

相對于硬件計算機軟件就是,計算機的軟件是將解決問題的方法,軟件是相對于硬件來說的...

計算機網絡管理軟件是為計算機網絡配置的系統軟件。它負責對網絡資源進行組織和管理&#xff0c;實現相互之間的通信。計算機網絡管理軟件包括網絡操作系統和數據通信處理程序。前者用于協調網絡中各計算機的操作系統及實現網絡資源的傳遞&#xff0c;后者用于網絡內的通信&…

數據冒險控制冒險_勞動生產率和其他冒險

數據冒險控制冒險Labor productivity is considered one of the most important indicators of a country’s well-being. However, we don’t know so much about it, let’s try to figure out how it is calculated, and how things are with it in the world (data source:…

如何把一個java程序打包成exe文件,運行在沒有java虛

如何把一個java程序打包成exe文件&#xff0c;運行在沒有java虛 核心提示&#xff1a;首先&#xff0c;將編譯好的程序打包成jar文件&#xff0c;然后做出exe&#xff0c;這樣代碼就不可見了&#xff1b;但是exe文件在沒有安裝jre的電腦上不能運行&#xff0c;如果要求客戶再去…

Java后端WebSocket的Tomcat實現

原文&#xff1a;https://www.cnblogs.com/xdp-gacl/p/5193279.html 一.WebSocket簡單介紹 隨著互聯網的發展&#xff0c;傳統的HTTP協議已經很難滿足Web應用日益復雜的需求了。近年來&#xff0c;隨著HTML5的誕生&#xff0c;WebSocket協議被提出&#xff0c;它實現了瀏覽器與…

加速業務交付,從 GKE 上使用 Kubernetes 和 Istio 開始

原文來源于&#xff1a;谷歌云技術博客 許多企業機構正在把全部或部分 IT 業務遷移到云端&#xff0c;幫助企業更好的運營。不過這樣的大規模遷移&#xff0c;在企業的實際操作中也有一定難度。不少企業保存在本地服務器的重要資源&#xff0c;并不支持直接遷移到云端。 另外&a…

knn 鄰居數量k的選取_選擇K個最近的鄰居

knn 鄰居數量k的選取Classification is more-or-less just a matter of figuring out to what available group something belongs.分類或多或少只是弄清楚某個事物所屬的可用組的問題。 Is Old Town Road a rap song or a country song?Old Town Road是說唱歌曲還是鄉村歌曲…

計算機網絡中 子網掩碼的算法,[網絡天地]子網掩碼快速算法(轉載)

看到一篇很好的資料&#xff0c;大家分享有很多人肯定對設定子網掩碼這個不熟悉&#xff0c;很頭疼&#xff0c;那么我現在就告訴大家一個很容易算子網掩碼的方法&#xff0c;幫助一下喜歡偷懶的人&#xff1a;)大家都應該知道2的0次方到10次方是多少把&#xff1f;也給大家說一…

EXTJS+JSP上傳文件帶進度條

需求來源是這樣的&#xff1a;上傳一個很大的excel文件到server&#xff0c; server會解析這個excel&#xff0c; 然后一條一條的插入到數據庫&#xff0c;整個過程要耗費很長時間&#xff0c;因此當用戶點擊上傳之后&#xff0c;需要顯示一個進度條&#xff0c;并且能夠根據后…

android Json詳解

Json:一種輕量級的數據交換格式&#xff0c;具有良好的可讀和便于快速編寫的特性。業內主流技術為其提供了完整的解決方案&#xff08;有點類似于正則表達式 &#xff0c;獲得了當今大部分語言的支持&#xff09;&#xff0c;從而可以在不同平臺間進行數據交換。JSON采用兼容性…

react實踐

React 最佳實踐一、 React 與 AJAXReact 只負責處理 View 這一層&#xff0c;它本身不涉及網絡請求 /AJAX: 第一&#xff0c;用什么技術從服務端獲取數據&#xff1b; 第二&#xff0c;獲取到的數據應該放在 react 組件的什么位置。 事實上是有很多的&#xff1a;fetch()、fetc…

什么樣的代碼是好代碼_什么是好代碼?

什么樣的代碼是好代碼編碼最佳實踐 (Coding Best-Practices) In the following section, I will introduce the topic at hand, giving you a sense of what this post will cover, and how each argument therein will be approached. Hopefully, this will help you decide w…