[{"data":1,"prerenderedAt":583},["ShallowReactive",2],{"content-query-RVCAdv5UVp":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"body":13,"_type":577,"_id":578,"_source":579,"_file":580,"_stem":581,"_extension":582},"/news/en/2592","en",false,"","Experience Sharing | Jiang Lei: Keep Calm and Carry On","This blog shares Jiang Lei's experience in the project [KubeEdge-Sedna Integration with MindSpore] of Open Source Promotion Plan (OSPP).","2023-02-24","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/07/03/883c7a73cff3470080a01905a08d32c5.png","news",{"type":14,"children":15,"toc":574},"root",[16,24,29,34,39,44,49,54,59,64,69,74,79,84,89,103,114,126,137,148,153,166,171,180,190,198,203,215,220,225,236,243,251,260,267,272,277,289,296,315,334,341,352,357,364,375,382,387,394,399,404,409,414,419,424,429,434,439,444,449,454,459,464,469,474,479,484,489,494,499,504,509,514,525,536,547,552,560,565],{"type":17,"tag":18,"props":19,"children":21},"element","h1",{"id":20},"experience-sharing-jiang-lei-keep-calm-and-carry-on",[22],{"type":23,"value":8},"text",{"type":17,"tag":25,"props":26,"children":27},"p",{},[28],{"type":23,"value":9},{"type":17,"tag":25,"props":30,"children":31},{},[32],{"type":23,"value":33},"1. Project Introduction",{"type":17,"tag":25,"props":35,"children":36},{},[37],{"type":23,"value":38},"(1). Project Name",{"type":17,"tag":25,"props":40,"children":41},{},[42],{"type":23,"value":43},"KubeEdge-Sedna Integration with MindSpore",{"type":17,"tag":25,"props":45,"children":46},{},[47],{"type":23,"value":48},"(2). Project Developer",{"type":17,"tag":25,"props":50,"children":51},{},[52],{"type":23,"value":53},"Jiang Lei",{"type":17,"tag":25,"props":55,"children":56},{},[57],{"type":23,"value":58},"(3). Project Mentor",{"type":17,"tag":25,"props":60,"children":61},{},[62],{"type":23,"value":63},"Liu Weilong",{"type":17,"tag":25,"props":65,"children":66},{},[67],{"type":23,"value":68},"(4). Project Requirements",{"type":17,"tag":25,"props":70,"children":71},{},[72],{"type":23,"value":73},"● Integrate KubeEdge-Sedna with MindSpore.",{"type":17,"tag":25,"props":75,"children":76},{},[77],{"type":23,"value":78},"● Implement the incremental learning demo based on MindSpore.",{"type":17,"tag":25,"props":80,"children":81},{},[82],{"type":23,"value":83},"● Make a proposal for integrating KubeEdge-Sedna with MindSpore.",{"type":17,"tag":25,"props":85,"children":86},{},[87],{"type":23,"value":88},"(5). Project Related Links",{"type":17,"tag":25,"props":90,"children":91},{},[92,94],{"type":23,"value":93},"Project details: ",{"type":17,"tag":95,"props":96,"children":100},"a",{"href":97,"rel":98},"https://summer-ospp.ac.cn/%23/org/prodetail/2298a0083",[99],"nofollow",[101],{"type":23,"value":102},"https://summer-ospp.ac.cn/#/org/prodetail/2298a0083",{"type":17,"tag":25,"props":104,"children":105},{},[106,108],{"type":23,"value":107},"Issue: ",{"type":17,"tag":95,"props":109,"children":112},{"href":110,"rel":111},"https://github.com/kubeedge/sedna/issues/307",[99],[113],{"type":23,"value":110},{"type":17,"tag":25,"props":115,"children":116},{},[117,119],{"type":23,"value":118},"Proposal Pull Request: ",{"type":17,"tag":95,"props":120,"children":123},{"href":121,"rel":122},"https://www.mindspore.cn/admin/pages/news/%20https:/github.com/kubeedge/sedna/pull/341",[99],[124],{"type":23,"value":125},"https://github.com/kubeedge/sedna/pull/341",{"type":17,"tag":25,"props":127,"children":128},{},[129,131],{"type":23,"value":130},"Implementation Pull Request: ",{"type":17,"tag":95,"props":132,"children":135},{"href":133,"rel":134},"https://github.com/kubeedge/sedna/pull/376",[99],[136],{"type":23,"value":133},{"type":17,"tag":25,"props":138,"children":139},{},[140,142],{"type":23,"value":141},"Project demonstration replay @KEAW'22 [Bilibili][4]: ",{"type":17,"tag":95,"props":143,"children":146},{"href":144,"rel":145},"https://www.bilibili.com/video/BV12W4y1p7sf",[99],[147],{"type":23,"value":144},{"type":17,"tag":25,"props":149,"children":150},{},[151],{"type":23,"value":152},"(6). Project Achievements",{"type":17,"tag":25,"props":154,"children":155},{},[156,158,164],{"type":23,"value":157},"Jiang Lei won the 2022 Most Promising award from the KudeEdge community and the 2022 Excellent Student of OSPP among 350 students for his accomplishments in the project. As a beginner in Sedna, MindSpore, and KudeEdge, Jiang Lei demonstrated strong learning abilities and a diligent work ethic. He actively reported his progress and sought guidance from his mentor to overcome any confusion. This helped him successfully design an incremental learning sample based on MindSpore and Sedna that met the end-to-end running requirements of KubeEdge. The project outcome was integrated into the KubeEdge-Sedna distributed collaborative AI framework. Jiang Lei also shared his experience in Zhihu (Chinese Quora) with a post titled ",{"type":17,"tag":159,"props":160,"children":161},"em",{},[162],{"type":23,"value":163},"KubeEdge-Sedna Setup Guidance—Building an Edge-Cloud Application",{"type":23,"value":165},"[5]. Furthermore, he intends to integrate TinyMS.",{"type":17,"tag":25,"props":167,"children":168},{},[169],{"type":23,"value":170},"2. Project Development",{"type":17,"tag":25,"props":172,"children":173},{},[174],{"type":17,"tag":175,"props":176,"children":177},"strong",{},[178],{"type":23,"value":179},"Solution of KubeEdge-Sedna Lib Integration with MindSpore",{"type":17,"tag":25,"props":181,"children":182},{},[183,185],{"type":23,"value":184},"PR link: ",{"type":17,"tag":95,"props":186,"children":188},{"href":121,"rel":187},[99],[189],{"type":23,"value":125},{"type":17,"tag":25,"props":191,"children":192},{},[193],{"type":17,"tag":194,"props":195,"children":197},"img",{"alt":7,"src":196},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/07/03/ebd1a182b79540cea76c1a3eee12bd9c.png",[],{"type":17,"tag":25,"props":199,"children":200},{},[201],{"type":23,"value":202},"Figure 1 Sedna lib framework",{"type":17,"tag":25,"props":204,"children":205},{},[206,208,213],{"type":23,"value":207},"Before running a model, you need to build an Estimator class that encapsulates a series of functions for model training, inference, evaluation, and saving. When the model invokes the incremental learning APIs provided by Sedna, Sedna lib performs a series of initialization operations. The lib initializes the incremental learning job first. When the ",{"type":17,"tag":175,"props":209,"children":210},{},[211],{"type":23,"value":212},"set_backend()",{"type":23,"value":214}," function identifies the specific framework type, it initializes the backend of the specific framework.",{"type":17,"tag":25,"props":216,"children":217},{},[218],{"type":23,"value":219},"To integrate MindSpore, perform the following steps:",{"type":17,"tag":25,"props":221,"children":222},{},[223],{"type":23,"value":224},"1. Implement the backend corresponding to the framework, which is used to parse some special parameters of a specific framework.",{"type":17,"tag":25,"props":226,"children":227},{},[228,230,234],{"type":23,"value":229},"2. Identify the corresponding framework in ",{"type":17,"tag":175,"props":231,"children":232},{},[233],{"type":23,"value":212},{"type":23,"value":235},".",{"type":17,"tag":25,"props":237,"children":238},{},[239],{"type":17,"tag":194,"props":240,"children":242},{"alt":7,"src":241},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/07/03/7ff3844b33da47338d9e33861068f53d.png",[],{"type":17,"tag":25,"props":244,"children":245},{},[246],{"type":17,"tag":175,"props":247,"children":248},{},[249],{"type":23,"value":250},"Incremental Learning Demo Based on MindSpore",{"type":17,"tag":25,"props":252,"children":253},{},[254,255],{"type":23,"value":184},{"type":17,"tag":95,"props":256,"children":258},{"href":133,"rel":257},[99],[259],{"type":23,"value":133},{"type":17,"tag":25,"props":261,"children":262},{},[263],{"type":17,"tag":194,"props":264,"children":266},{"alt":7,"src":265},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/07/03/489e24191082450cbab9fb7b09a09ab6.png",[],{"type":17,"tag":25,"props":268,"children":269},{},[270],{"type":23,"value":271},"Figure 2 Components required by the demo",{"type":17,"tag":25,"props":273,"children":274},{},[275],{"type":23,"value":276},"This demo implements the task of classifying dogs and croissants based on MobileNetV2. MobileNetV2 employs depthwise separable convolution, significantly reducing its parameters and allowing for faster training and inference on CPUs. This enables rapid completion of the training process in the demo.",{"type":17,"tag":25,"props":278,"children":279},{},[280,282,287],{"type":23,"value":281},"(1) Before building a demo, you need to commission the model locally to ensure that it can run properly. Before running the model, build an Estimator class that encapsulates a series of functions for model training, inference, evaluation, and saving, so as to call incremental learning APIs provided by Sedna lib. To simulate the Kubernetes environment locally for debugging, you can use the ",{"type":17,"tag":175,"props":283,"children":284},{},[285],{"type":23,"value":286},"Run/Debug Configuration",{"type":23,"value":288}," of your IDE to set environment variables that match those in a container.",{"type":17,"tag":25,"props":290,"children":291},{},[292],{"type":17,"tag":194,"props":293,"children":295},{"alt":7,"src":294},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/07/03/f4259ce3f48c45dfb1b5cf9f14c1cda3.png",[],{"type":17,"tag":25,"props":297,"children":298},{},[299,301,306,308,313],{"type":23,"value":300},"(2) Use ",{"type":17,"tag":175,"props":302,"children":303},{},[304],{"type":23,"value":305},"mindspore/mindspore-cpu:1.7.1",{"type":23,"value":307}," as the base image to create a Docker environment that supports Sedna and model running. Then, deploy the dataset, initial model, model, and custom resources for incremental learning defined by Sedna. At this time, the pod required by the incremental learning demo is running. You can run the ",{"type":17,"tag":175,"props":309,"children":310},{},[311],{"type":23,"value":312},"kubectl get pods -n sedna",{"type":23,"value":314}," command on the cloud to view the pod status or view container logs on the edge to obtain more detailed information.",{"type":17,"tag":25,"props":316,"children":317},{},[318,320,325,327,332],{"type":23,"value":319},"Here, a cluster consisting of two nodes is used as an example. ",{"type":17,"tag":175,"props":321,"children":322},{},[323],{"type":23,"value":324},"lenovo",{"type":23,"value":326}," indicates a cloud node, and ",{"type":17,"tag":175,"props":328,"children":329},{},[330],{"type":23,"value":331},"node01",{"type":23,"value":333}," indicates an edge node. When the demo is properly deployed on the cloud node, the following pod information is displayed:",{"type":17,"tag":25,"props":335,"children":336},{},[337],{"type":17,"tag":194,"props":338,"children":340},{"alt":7,"src":339},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/07/03/b9e839301e8e48c0a7819521192d2c08.png",[],{"type":17,"tag":25,"props":342,"children":343},{},[344,346,350],{"type":23,"value":345},"In Sedna, the training phase of incremental learning requires new data and certain conditions to be met. For example, the demo specifies that training can only begin when there are at least 50 samples in the dataset. When deploying the dataset's CRD, you can specify its URL on the host and add data to the file to meet the conditions for triggering training. If you increase the size of the dataset on ",{"type":17,"tag":175,"props":347,"children":348},{},[349],{"type":23,"value":331},{"type":23,"value":351},", you can find that training is triggered by viewing lc logs.",{"type":17,"tag":25,"props":353,"children":354},{},[355],{"type":23,"value":356},"Starting the training:",{"type":17,"tag":25,"props":358,"children":359},{},[360],{"type":17,"tag":194,"props":361,"children":363},{"alt":7,"src":362},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/07/03/20e9faaacdee49e9a9f504dee9befe91.png",[],{"type":17,"tag":25,"props":365,"children":366},{},[367,369,373],{"type":23,"value":368},"Training container logs of ",{"type":17,"tag":175,"props":370,"children":371},{},[372],{"type":23,"value":331},{"type":23,"value":374},":",{"type":17,"tag":25,"props":376,"children":377},{},[378],{"type":17,"tag":194,"props":379,"children":381},{"alt":7,"src":380},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/07/03/61805e171930454d8d5ed32887938d34.png",[],{"type":17,"tag":25,"props":383,"children":384},{},[385],{"type":23,"value":386},"Evaluate the accuracy of the trained and deployed models:",{"type":17,"tag":25,"props":388,"children":389},{},[390],{"type":17,"tag":194,"props":391,"children":393},{"alt":7,"src":392},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/07/03/6d15334d537b4ee78ab5e0cec06940f5.png",[],{"type":17,"tag":25,"props":395,"children":396},{},[397],{"type":23,"value":398},"According to the evaluation container's results, the accuracy of the incrementally trained model does not meet the deployment requirements when compared with the running model. As a result, Sedna will not update the model until a new round of incremental training meets the deployment requirements.",{"type":17,"tag":25,"props":400,"children":401},{},[402],{"type":23,"value":403},"3. Interview",{"type":17,"tag":25,"props":405,"children":406},{},[407],{"type":23,"value":408},"(1). Participation in OSPP",{"type":17,"tag":25,"props":410,"children":411},{},[412],{"type":23,"value":413},"OSPP: Could you please introduce yourself briefly and share your experience with open source?",{"type":17,"tag":25,"props":415,"children":416},{},[417],{"type":23,"value":418},"Jiang Lei: Before discovering OSPP, I used to search for open source projects organized by communities and student organizations on GitHub, where I also uploaded my course projects and demos. However, OSPP provided me with the opportunity to learn how to contribute to an open source project from the start.",{"type":17,"tag":25,"props":420,"children":421},{},[422],{"type":23,"value":423},"OSPP: How do you know OSPP?",{"type":17,"tag":25,"props":425,"children":426},{},[427],{"type":23,"value":428},"Jiang Lei: One of my friends recommended OSPP to me, and I've paid attention to this activity since 2021.",{"type":17,"tag":25,"props":430,"children":431},{},[432],{"type":23,"value":433},"OSPP: You won the Most Promising and Excellent Student awards at OSPP 2022. Do you have any experiences you'd like to share?",{"type":17,"tag":25,"props":435,"children":436},{},[437],{"type":23,"value":438},"Jiang Lei: When encountering difficulties during project development, I often reflect on my own before discussing with my classmates and mentors. This helps me with my development work.",{"type":17,"tag":25,"props":440,"children":441},{},[442],{"type":23,"value":443},"OSPP: You've already had rich project experience during school. Is this helpful to the project you participated in?",{"type":17,"tag":25,"props":445,"children":446},{},[447],{"type":23,"value":448},"Jiang Lei: The projects I participated in before were common, while OSPP is highly valuable. Additionally, by joining OSPP, I've met many students and mentors from different schools and industries.",{"type":17,"tag":25,"props":450,"children":451},{},[452],{"type":23,"value":453},"(2). Participation in the Open Source Community",{"type":17,"tag":25,"props":455,"children":456},{},[457],{"type":23,"value":458},"OSPP: Is there any impressive experience during the project? How does the community and mentor help you?",{"type":17,"tag":25,"props":460,"children":461},{},[462],{"type":23,"value":463},"Jiang Lei: Developing the demo was challenging for me because I was not familiar with incremental learning and MindSpore. However, when I asked questions in the community communication group, teachers always provided precise answers to help me build the demo framework. Additionally, my mentor, Mr. Liu Weilong, greatly assisted me in selecting demo tasks and MindSpore APIs.",{"type":17,"tag":25,"props":465,"children":466},{},[467],{"type":23,"value":468},"(3). Gains and Suggestions",{"type":17,"tag":25,"props":470,"children":471},{},[472],{"type":23,"value":473},"OSPP: OSPP aims to nurture and identify outstanding developers. Did you have any unexpected gains through participating in this program?",{"type":17,"tag":25,"props":475,"children":476},{},[477],{"type":23,"value":478},"Jiang Lei: My most unexpected gain was learning about various learning paradigms in cloud native + AI, particularly lifelong learning. I plan to continue exploring this topic in the future.",{"type":17,"tag":25,"props":480,"children":481},{},[482],{"type":23,"value":483},"OSPP: The OSPP 2023 is coming. Do you have any suggestions to the participants?",{"type":17,"tag":25,"props":485,"children":486},{},[487],{"type":23,"value":488},"Jiang Lei: OSPP provides a good opportunity to participate in the development of open source community projects. I hope that all participants take each project seriously and work diligently to complete it.",{"type":17,"tag":25,"props":490,"children":491},{},[492],{"type":23,"value":493},"4 Summary",{"type":17,"tag":25,"props":495,"children":496},{},[497],{"type":23,"value":498},"In May, when I was browsing projects on the OSPP official website, I was a junior student with only basic knowledge of deep learning and no specialized knowledge in any particular domain. After careful consideration, I chose the Sedna sub-project of the KubeEdge community. On one hand, I joined a small project that ran mask detection algorithms on edge devices and learned about edge computing. On the other hand, after fully understanding cloud native + AI, I discovered that there were many practical services and requirements in this area, which could greatly expand the capabilities of edge computing projects.",{"type":17,"tag":25,"props":500,"children":501},{},[502],{"type":23,"value":503},"The coding process didn't take long, with almost 70% of the time spent on learning and debugging. Through this project, I gained a basic understanding of the \"cloud native edge computing\" concept proposed by Kubernetes KubeEdge. The Sedna sub-project is truly powerful. Additionally, I saw many high-quality projects created by postgraduates and doctoral students and met many prominent figures in the KubeEdge community.",{"type":17,"tag":25,"props":505,"children":506},{},[507],{"type":23,"value":508},"That concludes the introduction to Jiang Lei's project. If you're interested in learning more about the project details, please watch the demo video from the KEAW'22 academic seminar. More cases will be integrated into KubeEdge-Sedna, so stay tuned!",{"type":17,"tag":25,"props":510,"children":511},{},[512],{"type":23,"value":513},"Reference",{"type":17,"tag":25,"props":515,"children":516},{},[517,519],{"type":23,"value":518},"[1] KubeEdge: ",{"type":17,"tag":95,"props":520,"children":523},{"href":521,"rel":522},"https://github.com/kubeedge/kubeedge",[99],[524],{"type":23,"value":521},{"type":17,"tag":25,"props":526,"children":527},{},[528,530],{"type":23,"value":529},"[2] KubeEdge-Sedna: ",{"type":17,"tag":95,"props":531,"children":534},{"href":532,"rel":533},"https://github.com/kubeedge/sedna",[99],[535],{"type":23,"value":532},{"type":17,"tag":25,"props":537,"children":538},{},[539,541],{"type":23,"value":540},"[3] KubeEdge-Ianvs: ",{"type":17,"tag":95,"props":542,"children":545},{"href":543,"rel":544},"https://github.com/kubeedge/ianvs",[99],[546],{"type":23,"value":543},{"type":17,"tag":25,"props":548,"children":549},{},[550],{"type":23,"value":551},"[4] KubeEdge-Sedna Integration with MindSpore [Project Demonstration] KEAW'22:",{"type":17,"tag":25,"props":553,"children":554},{},[555],{"type":17,"tag":95,"props":556,"children":558},{"href":144,"rel":557},[99],[559],{"type":23,"value":144},{"type":17,"tag":25,"props":561,"children":562},{},[563],{"type":23,"value":564},"[5] KubeEdge-Sedna Setup Guidance—Building an Edge-Cloud Application:",{"type":17,"tag":25,"props":566,"children":567},{},[568],{"type":17,"tag":95,"props":569,"children":572},{"href":570,"rel":571},"https://zhuanlan.zhihu.com/p/572681911",[99],[573],{"type":23,"value":570},{"title":7,"searchDepth":575,"depth":575,"links":576},4,[],"markdown","content:news:en:2592.md","content","news/en/2592.md","news/en/2592","md",1776506044994]