Month: July 2024
How to Make the Ports and Internal Variables of a FMU Block, Visible or Invisible?
I am using Matlab 2023a to insert an FMU block into my Simulink model with the following two lines of code:
>> addpath(‘path/of/the/fmu/file’)
>> fmu_block = add_block(‘simulink_extras/FMU Import/FMU’, ‘MyModel/MyFMU’, ‘FMUName’, ‘fmu_file.fmu’);
The FMU block is successfully inserted into my model, and everything is currently working well. When I double-click on the FMU block, I can see options to enable or disable the visibility of each output port and internal variable:
Now, I’m wondering how I can use a Matlab script to control the visibility of output ports or variables. I’ve already attempted to retrieve port information using get_param(…), such as this:
port_name = get_param(‘Model/FMU/1’, ‘Name’);
But unfortunately, Matlab gives me this error:
Invalid Simulink object name: ‘Model/FMU/1’.
Caused by:
‘FMU’ is not a SubSystem block.
Therefore, the question remains: How can I retrieve or modify the visibility parameter of the ports and variables within an FMU block? I would appreciate any assistance anyone can provide.I am using Matlab 2023a to insert an FMU block into my Simulink model with the following two lines of code:
>> addpath(‘path/of/the/fmu/file’)
>> fmu_block = add_block(‘simulink_extras/FMU Import/FMU’, ‘MyModel/MyFMU’, ‘FMUName’, ‘fmu_file.fmu’);
The FMU block is successfully inserted into my model, and everything is currently working well. When I double-click on the FMU block, I can see options to enable or disable the visibility of each output port and internal variable:
Now, I’m wondering how I can use a Matlab script to control the visibility of output ports or variables. I’ve already attempted to retrieve port information using get_param(…), such as this:
port_name = get_param(‘Model/FMU/1’, ‘Name’);
But unfortunately, Matlab gives me this error:
Invalid Simulink object name: ‘Model/FMU/1’.
Caused by:
‘FMU’ is not a SubSystem block.
Therefore, the question remains: How can I retrieve or modify the visibility parameter of the ports and variables within an FMU block? I would appreciate any assistance anyone can provide. I am using Matlab 2023a to insert an FMU block into my Simulink model with the following two lines of code:
>> addpath(‘path/of/the/fmu/file’)
>> fmu_block = add_block(‘simulink_extras/FMU Import/FMU’, ‘MyModel/MyFMU’, ‘FMUName’, ‘fmu_file.fmu’);
The FMU block is successfully inserted into my model, and everything is currently working well. When I double-click on the FMU block, I can see options to enable or disable the visibility of each output port and internal variable:
Now, I’m wondering how I can use a Matlab script to control the visibility of output ports or variables. I’ve already attempted to retrieve port information using get_param(…), such as this:
port_name = get_param(‘Model/FMU/1’, ‘Name’);
But unfortunately, Matlab gives me this error:
Invalid Simulink object name: ‘Model/FMU/1’.
Caused by:
‘FMU’ is not a SubSystem block.
Therefore, the question remains: How can I retrieve or modify the visibility parameter of the ports and variables within an FMU block? I would appreciate any assistance anyone can provide. fmu, visibility, set_param MATLAB Answers — New Questions
VPN Gateway – BGP AS PATH – Steer which VPN tunnel traffic will flow form Azure to OnPrem
Can anyone confirm whether in the topology that Microsoft calls “Active-active VPN gateways” we can steer which VPN tunnel is utilized using AS PATH? Or is it by definition active/active, meaning we can’t avoid utilizing both tunnels simultaneously and probably we have to deal with asymetric routing?
MS article about different topologies:
https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-highlyavailable#activeactiveonprem
My findings:
Because the Azure gateway instances are in active-active configuration, the traffic from your Azure virtual network to your on-premises network will be routed through both tunnels simultaneously, even if your on-premises VPN device might favor one tunnel over the other.
However, according to the Microsoft FAQ about BGP:
Yes, Azure VPN gateway honors AS Path prepending to help make routing decisions when BGP is enabled. A shorter AS Path is preferred in BGP path selection.
Can anyone confirm whether in the topology that Microsoft calls “Active-active VPN gateways” we can steer which VPN tunnel is utilized using AS PATH? Or is it by definition active/active, meaning we can’t avoid utilizing both tunnels simultaneously and probably we have to deal with asymetric routing? MS article about different topologies:https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-highlyavailable#activeactiveonprem My findings:Because the Azure gateway instances are in active-active configuration, the traffic from your Azure virtual network to your on-premises network will be routed through both tunnels simultaneously, even if your on-premises VPN device might favor one tunnel over the other. However, according to the Microsoft FAQ about BGP:Yes, Azure VPN gateway honors AS Path prepending to help make routing decisions when BGP is enabled. A shorter AS Path is preferred in BGP path selection. Read More
macros in one click to some files
I learn writing of macroses. I know, that I can apply it to some files at one click. But I don’t know how to do it. Can anybody help me?
I learn writing of macroses. I know, that I can apply it to some files at one click. But I don’t know how to do it. Can anybody help me? Read More
Viva Engage Network Administrator
Hi,
Viva Engage Network Administrator is able to see Viva Network analytics but export option is not available. Can someone help on how to get export option enabled for this?
Regards
Amit
Hi, Viva Engage Network Administrator is able to see Viva Network analytics but export option is not available. Can someone help on how to get export option enabled for this? RegardsAmit Read More
how to turn off link sharing on android text messages
how to turn off link sharing on android text messages
how to turn off link sharing on android text messages Read More
Azure Update Manager to support CIS hardened images among other images
What’s coming in by end of July 2024: Azure Update Manager will add support for 35 CIS hardened images. This is the first time that Update Management product in Azure is supporting CIS hardened images. Apart from CIS hardened images, Azure Update Manager will also add support for 59 other images to unblock Automation Update Management migrations to Azure Update Manager.
What’s coming in September: After this release, another batch of 30 images will be added support for.
Please refer to the article below to check the details of which images will be supported.
Below 35 CIS images will be supported by Azure Update Manager by end of July 2024. Please note Publisher for all these images is center-for-internet-security-inc.
Offer
Plan
cis-windows-server
cis-windows-server2016-l1-gen1
cis-windows-server2019-l1-gen1
cis-windows-server2019-l1-gen2
cis-windows-server2019-l2-gen1
cis-windows-server2022-l1-gen2
cis-windows-server2022-l2-gen2
cis-windows-server2022-l1-gen1
cis-windows-server-2022-l1
cis-windows-server-2022-l1
cis-windows-server-2022-l1-gen2
cis-windows-server-2022-l2
cis-windows-server-2022-l2
cis-windows-server-2022-l2-gen2
cis-windows-server-2019-v1-0-0-l1
cis-ws2019-l1
cis-windows-server-2019-v1-0-0-l2
cis-ws2019-l2
cis-windows-server-2016-v1-0-0-l1
cis–l1
cis-windows-server-2016-v1-0-0-l2
cis-ws2016-l2
cis-windows-server-2012-r2-v2-2-1-l2
cis-ws2012-r2-l2
cis-rhel9-l1
cis-rhel9-l1
cis-rhel9-l1-gen2
cis-rhel-8-l1
cis-rhel-8-l2
cis-rhel8-l2
cis-rhel-7-l2
cis-rhel7-l2
cis-rhel
cis-redhat8-l1-gen1
cis-redhat8-l2-gen1
cis-redhat7-l1-gen1
cis-redhat9-l1-gen2
cis-redhat9-l1-gen1
cis-ubuntu-linux-2204-l1
cis-ubuntu-linux-2204-l1
cis-ubuntu-linux-2204-l1-gen2
cis-ubuntu-linux-2004-l1
cis-ubuntu2004-l1
cis-ubuntu-linux-1804-l1
cis-ubuntu1804-l1
cis-ubuntu
cis-ubuntu1804-l1
cis-ubuntulinux2004-l1-gen1
cis-ubuntulinux2204-l1-gen1
cis-ubuntulinux2204-l1-gen2
cis-oracle-linux-8-l1
cis-oracle8-l1
Apart from CIS hardened images, below are the other 59 images which will be supported by Azure Update Manager by end of July 2024:
Publisher
Offer
Plan
almalinux
almalinux-x86_64
8_7-gen2
belindaczsro1588885355210
belvmsrv01
belvmsrv003
cloudera
cloudera-centos-os
7_5
cloud-infrastructure-services
rds-farm-2019
rds-farm-2019
cloud-infrastructure-services
ad-dc-2019
ad-dc-2019
cloud-infrastructure-services
sftp-2016
sftp-2016
cloud-infrastructure-services
ad-dc-2016
ad-dc-2016
cloud-infrastructure-services
hpc2019-windows-server-2019
hpc2019-windows-server-2019
cloud-infrastructure-services
dns-ubuntu-2004
dns-ubuntu-2004
cloud-infrastructure-services
servercore-2019
servercore-2019
cloud-infrastructure-services
ad-dc-2022
ad-dc-2022
cloud-infrastructure-services
squid-ubuntu-2004
squid-ubuntu-2004
cognosys
sql-server-2016-sp2-std-win2016-debug-utilities
sql-server-2016-sp2-std-win2016-debug-utilities
esri
arcgis-enterprise
byol-1091
byol-111
byol-108
byol-1081
byol-109
esri
arcgis-enterprise-107
byol-1071
esri
arcgis-enterprise-106
byol-1061
esri
pro-byol
pro-byol-29
filemagellc
filemage-gateway-vm-win
filemage-gateway-vm-win-002
filemage-gateway-vm-win-001
github
github-enterprise
github-enterprise
matillion
matillion
matillion-etl-for-snowflake
microsoft-ads
windows-data-science-vm
windows2016
windows2016byol
microsoft-dsvm
ubuntu-1804
1804-gen2
netapp
netapp-oncommand-cloud-manager
occm-byol
nginxinc
nginx-plus-ent-v1
nginx-plus-ent-centos7
ntegralinc1586961136942
ntg_oracle_8_7
ntg_oracle_8_7
procomputers
almalinux-8-7
almalinux-8-7
procomputers
rhel-8-2
rhel-8-2
RedHat
rhel
8_9
redhat
rhel-byos
rhel-lvm79
rhel-lvm84-gen2
rhel-lvm85-gen2
rhel-lvm82-gen2
rhel-lvm86-gen2
rhel-lvm83
rhel-lvm84
rhel-lvm79-gen2
rhel-lvm87-gen2
rhel-raw76
rhel-lvm86
rhel-lvm8
rhel
8.1
redhat
rhel-sap
7.4
redhat
rhel-sap
7.7
redhat
rhel
89-gen2
southrivertech1586314123192
tn-ent-payg
Tnentpayg
southrivertech1586314123192
tn-sftp-payg
Tnsftppayg
suse
sles-sap-15-sp2-byos
gen2
suse
sles-15-sp5
gen2
talend
talend_re_image
tlnd_re
thorntechnologiesllc
sftpgateway
Sftpgateway
veeam
office365backup
veeamoffice365backup
veeam
veeam-backup-replication
veeam-backup-replication-v11
zscaler
zscaler-private-access
zpa-con-azure
Below images will be supported in September:
Publisher
Offer
Plan
aod
win2019azpolicy
win2019azpolicy
belindaczsro1588885355210
belvmsrv03
belvmsrv001
center-for-internet-security-inc
cis-rhel-7-v2-2-0-l1
cis-rhel7-l1
center-for-internet-security-inc
cis-rhel-7-stig
cis-rhel-7-stig
center-for-internet-security-inc
cis-win-2016-stig
cis-win-2016-stig
center-for-internet-security-inc
cis-windows-server-2012-r2-v2-2-1-l1
cis-ws2012-r2-l1
cloudrichness
rockey_linux_image
rockylinux86
Credativ
Debian
8
microsoftdynamicsnav
dynamicsnav
2017
microsoftwindowsserver
windowsserver-hub
2012-r2-datacenter-hub
2016-datacenter-hub
MicrosoftWindowsServer
WindowsServer-HUB
2016-Datacenter-HUB
ntegralinc1586961136942
ntg_cbl_mariner_2
ntg_cbl_mariner_2_gen2
openvpn
openvpnas
access_server_byol
rapid7
nexpose-scan-engine
nexpose-scan-engine
rapid7
rapid7-vm-console
rapid7-vm-console
suse
sles
12-sp3
suse
sles-15-sp1-basic
gen1
suse
sles-15-sp2-basic
gen1
suse
sles-15-sp3-basic
gen1
gen2
suse
sles-15-sp4-basic
gen2
suse
sles-sap
12-sp3
15
gen2-15
suse
sles-sap-byos
15
suse
SLES-SAP-BYOS
15
suse
sles-sap-15-sp1-byos
gen1
Tenable
tenablecorenessus
tenablecorenessusbyol
Microsoft Tech Community – Latest Blogs –Read More
Folders not found when started newly installed MATLAB R2024a
After update to MATLAB R2024a, I enountered some error messages in the command window saying some folders or files not existed, please refer to attached image. I can’t do anything now. Please advise how I can resolve it.
Thank you very much!After update to MATLAB R2024a, I enountered some error messages in the command window saying some folders or files not existed, please refer to attached image. I can’t do anything now. Please advise how I can resolve it.
Thank you very much! After update to MATLAB R2024a, I enountered some error messages in the command window saying some folders or files not existed, please refer to attached image. I can’t do anything now. Please advise how I can resolve it.
Thank you very much! r2024a, installation MATLAB Answers — New Questions
Debug mode for RL agent networks
Is there any way to enter debug mode, to see what is happening inside the RL agent nets while training is running?
Some of my layers output NaN and I would like to know which one. I would also like to monitor to outputs of each layer.
Thanks in advance!
NicolasIs there any way to enter debug mode, to see what is happening inside the RL agent nets while training is running?
Some of my layers output NaN and I would like to know which one. I would also like to monitor to outputs of each layer.
Thanks in advance!
Nicolas Is there any way to enter debug mode, to see what is happening inside the RL agent nets while training is running?
Some of my layers output NaN and I would like to know which one. I would also like to monitor to outputs of each layer.
Thanks in advance!
Nicolas reinforcement learning, matlab, deep learning, debug mode MATLAB Answers — New Questions
Combining datasets using Geo data/ How to retain data values using ‘imfuse’
Hi,
I am trying to imfuse these two datasets Data1 & Data2 (data type Double) with R1 and R2 (R1 and R2 are spatial coordinates data & pixel sizes etc.). However, the end product ‘AB’ is changing the data type to uint 8, and this change of data type is also affecting the values in dataset (changed). I have checked the documentation but the output of ‘Imfuse’ is ‘uint 8’.
I need some advise, How can I embed these two datasets using geo data, which dont alter its data values. If there is some other function or technique to do it. Kindly advise.
AB=imfuse(data2,R2,data1,R1,’blend’,’Scaling’,’joint’);
figure;
imshow(AB);
I have attached the files.Hi,
I am trying to imfuse these two datasets Data1 & Data2 (data type Double) with R1 and R2 (R1 and R2 are spatial coordinates data & pixel sizes etc.). However, the end product ‘AB’ is changing the data type to uint 8, and this change of data type is also affecting the values in dataset (changed). I have checked the documentation but the output of ‘Imfuse’ is ‘uint 8’.
I need some advise, How can I embed these two datasets using geo data, which dont alter its data values. If there is some other function or technique to do it. Kindly advise.
AB=imfuse(data2,R2,data1,R1,’blend’,’Scaling’,’joint’);
figure;
imshow(AB);
I have attached the files. Hi,
I am trying to imfuse these two datasets Data1 & Data2 (data type Double) with R1 and R2 (R1 and R2 are spatial coordinates data & pixel sizes etc.). However, the end product ‘AB’ is changing the data type to uint 8, and this change of data type is also affecting the values in dataset (changed). I have checked the documentation but the output of ‘Imfuse’ is ‘uint 8’.
I need some advise, How can I embed these two datasets using geo data, which dont alter its data values. If there is some other function or technique to do it. Kindly advise.
AB=imfuse(data2,R2,data1,R1,’blend’,’Scaling’,’joint’);
figure;
imshow(AB);
I have attached the files. image processing, digital image processing, data MATLAB Answers — New Questions
Speeding up numerical gradient of tensor with FFTs
I have a gradient problem that involves the following function: adding a phase to each column in a matrix and computing the FFT of each column, and aggregating all FFTs into a new matrix.
My brute-force numerical gradient is adding a small phase to each column, iteratively, and then computing the loss by comparing it with some known matrix. currX is the current guess of phases, Ts2pHH is the matrix to whose columns these phases are added, and the function is computing by taking a sum along 2 dimensions of the intensity and then adding it up.
I want to know if this can be done more efficiently, because for my matrix size (~1000×1000) this takes around 2 minutes, which is very slow.
My code is shown below:
for k = 1:length(currX)
currX_perturbed = currX;
currX_perturbed(k) = currX_perturbed(k) + epsilon;
phases_perturbed = exp(1i * [0, currX_perturbed]);
Tcorr_perturbed = Ts2pHH .* phases_perturbed;
TcorrFFT_perturbed = fftshift(fft(fft(fft(fft(reshape(Tcorr_perturbed, [Npx, Npx, Nin, Nin]), [], 3), [], 4), [], 1), [], 2));
inputFreq_perturbed = squeeze(sum(sum(abs(TcorrFFT_perturbed).^2, 1), 2));
gradient(k) = gradient(k) + (-sum(inputFreq_perturbed .* support, ‘all’) – loss) / epsilon;
endI have a gradient problem that involves the following function: adding a phase to each column in a matrix and computing the FFT of each column, and aggregating all FFTs into a new matrix.
My brute-force numerical gradient is adding a small phase to each column, iteratively, and then computing the loss by comparing it with some known matrix. currX is the current guess of phases, Ts2pHH is the matrix to whose columns these phases are added, and the function is computing by taking a sum along 2 dimensions of the intensity and then adding it up.
I want to know if this can be done more efficiently, because for my matrix size (~1000×1000) this takes around 2 minutes, which is very slow.
My code is shown below:
for k = 1:length(currX)
currX_perturbed = currX;
currX_perturbed(k) = currX_perturbed(k) + epsilon;
phases_perturbed = exp(1i * [0, currX_perturbed]);
Tcorr_perturbed = Ts2pHH .* phases_perturbed;
TcorrFFT_perturbed = fftshift(fft(fft(fft(fft(reshape(Tcorr_perturbed, [Npx, Npx, Nin, Nin]), [], 3), [], 4), [], 1), [], 2));
inputFreq_perturbed = squeeze(sum(sum(abs(TcorrFFT_perturbed).^2, 1), 2));
gradient(k) = gradient(k) + (-sum(inputFreq_perturbed .* support, ‘all’) – loss) / epsilon;
end I have a gradient problem that involves the following function: adding a phase to each column in a matrix and computing the FFT of each column, and aggregating all FFTs into a new matrix.
My brute-force numerical gradient is adding a small phase to each column, iteratively, and then computing the loss by comparing it with some known matrix. currX is the current guess of phases, Ts2pHH is the matrix to whose columns these phases are added, and the function is computing by taking a sum along 2 dimensions of the intensity and then adding it up.
I want to know if this can be done more efficiently, because for my matrix size (~1000×1000) this takes around 2 minutes, which is very slow.
My code is shown below:
for k = 1:length(currX)
currX_perturbed = currX;
currX_perturbed(k) = currX_perturbed(k) + epsilon;
phases_perturbed = exp(1i * [0, currX_perturbed]);
Tcorr_perturbed = Ts2pHH .* phases_perturbed;
TcorrFFT_perturbed = fftshift(fft(fft(fft(fft(reshape(Tcorr_perturbed, [Npx, Npx, Nin, Nin]), [], 3), [], 4), [], 1), [], 2));
inputFreq_perturbed = squeeze(sum(sum(abs(TcorrFFT_perturbed).^2, 1), 2));
gradient(k) = gradient(k) + (-sum(inputFreq_perturbed .* support, ‘all’) – loss) / epsilon;
end gradient, optimization, speed, fft, for loop, matrix, loop, iteration MATLAB Answers — New Questions
MS Project Edition texte rapide ?!
Hello les pro,
Besoin d’un tips sous MS Project pour éditer l’ensemble ( ou selection partiel) du projet pour insérer en début de ligne un texte de référence propre au projet.
Exemple un niveau supérieur se répétant en début de texte de toutes les sous lignes / sous niveau
Ex : Modèle 42
Modèle 42 – Voiture
Modèle 42 – Porte
Modèle 42 – Vitre
Merci pour l’info
A+
Olimsproject
Hello les pro, Besoin d’un tips sous MS Project pour éditer l’ensemble ( ou selection partiel) du projet pour insérer en début de ligne un texte de référence propre au projet. Exemple un niveau supérieur se répétant en début de texte de toutes les sous lignes / sous niveau Ex : Modèle 42 Modèle 42 – Voiture Modèle 42 – Porte Modèle 42 – Vitre Merci pour l’info A+Olimsproject Read More
Complicated Conditional Formatting?
Hi Everyone,
I was wondering if I can get some help with an issue I’m having. I have a column with a numerical value and a Yes/No column. If the numerical value is 3 or greater and a No is entered into the column, I would like it to change colors. I’m having difficulties with the formula. Can someone please help?
Hi Everyone, I was wondering if I can get some help with an issue I’m having. I have a column with a numerical value and a Yes/No column. If the numerical value is 3 or greater and a No is entered into the column, I would like it to change colors. I’m having difficulties with the formula. Can someone please help? Read More
how do i recover my old hotmail account? (i think Microsoft deleted it)
Hi, i made a Hotmail account a while ago sometime between 2016 and 2018. It was made under the name of “ellieflows08 @ hotmail.com” (I put spaces in hopes it wouldn’t remove the email address this time), and every time I use a website to see if it exists the websites say I do, but when I go to recover it Microsoft says it doesn’t exist. I will admit i was inactive on that account after a year or two of using it but at one point I got logged out of it, forgot the password and didn’t know recovery existed, does Microsoft delete old inactive Hotmail accounts? And if so is there a way I could get it back?
Hi, i made a Hotmail account a while ago sometime between 2016 and 2018. It was made under the name of “ellieflows08 @ hotmail.com” (I put spaces in hopes it wouldn’t remove the email address this time), and every time I use a website to see if it exists the websites say I do, but when I go to recover it Microsoft says it doesn’t exist. I will admit i was inactive on that account after a year or two of using it but at one point I got logged out of it, forgot the password and didn’t know recovery existed, does Microsoft delete old inactive Hotmail accounts? And if so is there a way I could get it back? Read More
More profile icons
Hi,
I am using Edge Profiles for different customer logins. This means when we work for a customer we are using a separate edge profile, where we login with a separate user which is registered in the customers tenant.
Every profile gets it’s own icon so I can quickly identify in which tenant this browser is registered in.
Since we have many customers I used up the icons multiple times – so how about:
1. The ability to upload custom icons (the preferred way).
2. Edge providing more profile images – currently there are twenty different profile images.
What do you think?
Hi,I am using Edge Profiles for different customer logins. This means when we work for a customer we are using a separate edge profile, where we login with a separate user which is registered in the customers tenant.Every profile gets it’s own icon so I can quickly identify in which tenant this browser is registered in.Since we have many customers I used up the icons multiple times – so how about: 1. The ability to upload custom icons (the preferred way).2. Edge providing more profile images – currently there are twenty different profile images. What do you think? Read More
How to fix QuickBook direct deposit not working issue after update?
I have been trying to process pay-roll through Quick-Books, but the direct deposit feature isn’t working. Employees aren’t receiving their payments on time, causing a lot of frustration. I’ve double-checked the account details and everything seems correct. Can you provide a step-by-step solution to fix this issue?
I have been trying to process pay-roll through Quick-Books, but the direct deposit feature isn’t working. Employees aren’t receiving their payments on time, causing a lot of frustration. I’ve double-checked the account details and everything seems correct. Can you provide a step-by-step solution to fix this issue? Read More
How to delete files remotely on Intune devices
Hi All,
Please help me to delete below files at below location remotely on all intune devices.
%appdata%Microsoftusertemplateswordtemplate1.dotx
%appdata%Microsoftusertemplateswordtemplate1.dotm
Thank you
Hi All, Please help me to delete below files at below location remotely on all intune devices.%appdata%Microsoftusertemplateswordtemplate1.dotx%appdata%Microsoftusertemplateswordtemplate1.dotmThank you Read More
i want to learn new thing and every thin in exel
Hi everyone my name is Lateef Adewale,
Field Engineer @ cool continental technical solution company in Nigeria
Good day to you all my community experts,
My mission is to become an EXCEL Expert
My vision is to make Microsoft and this community, proud that we thought him.
thanks to everyone.
Hi everyone my name is Lateef Adewale, Field Engineer @ cool continental technical solution company in NigeriaGood day to you all my community experts,My mission is to become an EXCEL Expert My vision is to make Microsoft and this community, proud that we thought him. thanks to everyone. Read More
One drive from business to sharepoint online site migration within same Microsoft tenant
Hi All,
I would like to migrate data from one drive from business to sharepoint site online within same tenant with sharing links intact and permissions. i tried copy to… function but we lost the sharing and permissions assigned to those folders. is there a recommended and reliable way to achieve this scenerio.
Thanks & Regards,
Vipin
Hi All,I would like to migrate data from one drive from business to sharepoint site online within same tenant with sharing links intact and permissions. i tried copy to… function but we lost the sharing and permissions assigned to those folders. is there a recommended and reliable way to achieve this scenerio. Thanks & Regards,Vipin Read More
How to fix QuickBook pay-roll not working issue after update?
I’ve been experiencing issues with Quick-Books pay-roll not working properly. It fails to process pay-roll, and I keep getting error messages. This has been causing delays in paying my employees on time. What could be causing this problem, and how can I fix it? Any guidance would be greatly appreciated!
I’ve been experiencing issues with Quick-Books pay-roll not working properly. It fails to process pay-roll, and I keep getting error messages. This has been causing delays in paying my employees on time. What could be causing this problem, and how can I fix it? Any guidance would be greatly appreciated! Read More
Running Phi-3-vision via ONNX on Jetson Platform
Hi, I’m Jambo a Microsoft Learn Student Ambassador.
This article aims to run the quantized Phi-3-vision model in ONNX format on the Jetson platform and successfully perform inference for image+text dialogue tasks.
What is Jetson?
The Jetson platform, introduced by NVIDIA, consists of small arm64 devices equipped with powerful GPU computing capabilities. Designed specifically for edge computing and AI applications, Jetson devices run on Linux, enabling complex computing tasks with low power consumption. This makes them ideal for developing embedded AI and machine learning projects.
For other versions of the Phi-3 model, we can use llama.cpp to convert them into GUFF format to run on Jetson, and easily switch between different quantizations. Alternatively, you can conveniently use services like ollama or llamaedge which are based on llama.cpp. More information can be found in the Phi-3CookBook.
However, for the vision version, there is currently no way to convert it into GUFF format (#7444). Additionally, resource-constrained edge devices struggle to run the original model without quantization via transformers. Therefore, we can use ONNX Runtime to run the quantized model in ONNX format.
What is ONNX Runtime?
ONNX Runtime is a high-performance inference engine designed to accelerate and execute AI models in the ONNX (Open Neural Network Exchange) format. The onnxruntime-genai is an API specifically built for LLM (Large Language Model) models, providing a simple way to run models like Llama, Phi, Gemma, and Mistral.
At the time of writing this article, onnxruntime-genai does not have a precompiled version for aarch64 + GPU, so we need to compile it ourselves.
Compiling onnxruntime-genai
Environment
Jetpack 6.0 [L4T 36.3.0]
Compilation platform: Jetson Orin
Inference platform: Jetson Orin Nano
Cloning the onnxruntime-genai Repository
git clone https://github.com/microsoft/onnxruntime-genai
cd onnxruntime-genai
Installing ONNX Runtime
Download the aarch64 version of ONNX Runtime from the GitHub releases page and extract the header files and necessary library files.
Note: Ensure you download the aarch64 version. If there is a newer version, you can replace the version number in the link.
wget https://github.com/microsoft/onnxruntime/releases/download/v1.18.1/onnxruntime-linux-aarch64-1.18.1.tgz
tar -xvf onnxruntime-linux-aarch64-1.18.1.tgz
mv onnxruntime-linux-aarch64-1.18.1 ort
ONNX Runtime does not provide a precompiled version for aarch64 + GPU, but we can get the required library files from the dusty-nv image.
The following commands will copy the required library files from the dusty-nv image to the ort/lib directory.
id=$(docker create dustynv/onnxruntime:r36.2.0)
docker cp $id:/usr/local/lib/libonnxruntime*.so* – > ort/lib/
docker rm -v $id
Compiling onnxruntime-genai
You should still be in the onnxruntime-genai directory at this point.
Now we need to prepare to build the Python API. You can use Python >=3.6 for the compilation. JetPack 6.0 comes with Python 3.10 by default, but you can switch to other versions for the compilation. The compiled whl can only be installed on the Python version used during the compilation.
Note: The compilation process will require a significant amount of memory. Therefore, if your Jetson device has limited memory (like the Orin NX), do not use the –parallel parameter.
python3 build.py –use_cuda –cuda_home /usr/local/cuda-12.2 –skip_tests –skip_csharp [–parallel]
The compiled files will be located in the build/Linux/Release/dist/wheel directory, and we only need the .whl file.
You can copy the whl file to other Jetson platforms with the same environment (CUDA) for installation.
Note: The generated subdirectory may differ, but we only need the .whl file from the build directory.
Installing onnxruntime-genai
If you have multiple CUDA versions, you might need to set the CUDA_PATH environment variable to ensure it points to the same version used during compilation.
export CUDA_PATH=/usr/local/cuda-12.2
Navigate to the directory where the whl file is located, or copy the whl file to another directory for installation using the following command.
pip3 install *.whl
Running the Phi-3-vision Model
Downloading the Model
Download the Phi-3-vision model for onnx-cuda from huggingface.
pip3 install huggingface-hub[cli]
The FP16 model requires 8 GB of VRAM. If you are running on a device with more resources like the Jetson Orin, you can opt for the FP32 model.
The Int 4 model is a quantized version, requiring only 3 GB of VRAM. This is suitable for more compact devices like the Jetson Orin Nano.
huggingface-cli download microsoft/Phi-3-vision-128k-instruct-onnx-cuda –include cuda-fp16/* –local-dir .
# Or
huggingface-cli download microsoft/Phi-3-vision-128k-instruct-onnx-cuda –include cuda-int4-rtn-block-32/* –local-dir .
Running the Example Script
Download the official example script and an example image.
# Download example script
wget https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/phi3v.py
# Download example image
wget https://onnxruntime.ai/images/table.png
Run the example script.
python3 phi3v.py -m cuda-int4-rtn-block-32
First, input the path to the image, for example, table.png.
Next, input the prompt text, for example: Convert this image to markdown format.
“`markdown
| Product | Qtr 1 | Qtr 2 | Grand Total |
|———————|———-|———-|————-|
| Chocolade | $744.60 | $162.56 | $907.16 |
| Gummibarchen | $5,079.60| $1,249.20| $6,328.80 |
| Scottish Longbreads | $1,267.50| $1,062.50| $2,330.00 |
| Sir Rodney’s Scones | $1,418.00| $756.00 | $2,174.00 |
| Tarte au sucre | $4,728.00| $4,547.92| $9,275.92 |
| Chocolate Biscuits | $943.89 | $349.60 | $1,293.49 |
| Total | $14,181.59| $8,127.78| $22,309.37 |
“`
The table lists various products along with their sales figures for Qtr 1, Qtr 2, and the Grand Total. The products include Chocolade, Gummibarchen, Scottish Longbreads, Sir Rodney’s Scones, Tarte au sucre, and Chocolate Biscuits. The Grand Total column sums up the sales for each product across the two quarters.
Note: The first round of dialogue during script execution might be slow, but subsequent dialogues will be faster.
We can use Jtop to monitor resource usage:
The above inference is run on Jetson Orin Nano using the Int 4 quantized model. As shown, the Python process occupies 5.4 GB of VRAM for inference, with minimal CPU load and nearly full GPU utilization during inference.
We can modify the example script to use the time function at key points to measure the inference speed, which is remarkably fast.
All of this is achieved on a device with a power consumption of just 15W.
Microsoft Tech Community – Latest Blogs –Read More