Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/actions/versions/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
name: Versions
description: Parse git versions from config files

inputs:
build-manifest-dir:
description: 'Directory where build_manifest.json will be created (optional)'
required: false
default: ''
openvino-repo-path:
description: 'Path to OpenVINO repository (for TBB version detection)'
required: false
default: ''
npu-compiler-repo-path:
description: 'Path to NPU Compiler repository (for LLVM submodule SHA detection)'
required: false
default: ''

outputs:
openvino-repository:
description: 'OpenVINO Repository full name: fork/openvino'
Expand Down Expand Up @@ -38,6 +52,15 @@ outputs:
opencv-sha:
description: 'OpenCV commit SHA'
value: ${{ steps.read-ocv-sha.outputs.ocv-sha }}
llvm-sha:
description: 'LLVM SHA detected in NPU Compiler submodule'
value: ${{ steps.get-llvm-sha.outputs.llvm-sha }}
tbb-version:
description: 'TBB version detected from OpenVINO'
value: ${{ steps.get-tbb-version.outputs.tbb-version }}
build-manifest-path:
description: 'Absolute path to build_manifest.json file'
value: ${{ steps.create-build-manifest.outputs.build-manifest-path }}

runs:
using: 'composite'
Expand Down Expand Up @@ -179,3 +202,67 @@ runs:
echo "OpenCV commit sha = $OCV_SHA"
echo "ocv-repository=$OCV_ORG/opencv" >> $GITHUB_OUTPUT
echo "ocv-sha=$OCV_SHA" >> $GITHUB_OUTPUT

- name: Get LLVM submodule commit sha
id: get-llvm-sha
shell: bash
run: |
LLVM_SHA="N/A"

if [[ -n "${{ inputs.npu-compiler-repo-path }}" ]]; then
LLVM_SHA=$(git -C "${{ inputs.npu-compiler-repo-path }}" ls-tree HEAD thirdparty/llvm-project | awk '{print $3}')
[[ -z "$LLVM_SHA" ]] && LLVM_SHA="N/A"
fi

echo "LLVM commit sha = $LLVM_SHA"
echo "llvm-sha=$LLVM_SHA" >> $GITHUB_OUTPUT

- name: Get TBB version from OpenVINO
id: get-tbb-version
shell: bash
run: |
TBB_VERSION="N/A"

if [[ -n "${{ inputs.openvino-repo-path }}" ]]; then
TBB_VERSION_FILES=$(find "${{ inputs.openvino-repo-path }}/temp" -name "TBBConfigVersion.cmake" 2>/dev/null)

if [[ -n "$TBB_VERSION_FILES" ]]; then
TBB_VERSION=$(grep -h 'set(PACKAGE_VERSION' $TBB_VERSION_FILES | \
grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
fi

[[ -z "$TBB_VERSION" ]] && TBB_VERSION="N/A"
fi

echo "TBB version = $TBB_VERSION"
echo "tbb-version=$TBB_VERSION" >> $GITHUB_OUTPUT

- name: Create build manifest
id: create-build-manifest
if: inputs.build-manifest-dir != ''
shell: bash
run: |
OUTPUT_DIR="${{ inputs.build-manifest-dir }}"

mkdir -p "$OUTPUT_DIR"

jq -n \
--arg openvino_sha "${{ steps.read-openvino-sha.outputs.openvino-sha }}" \
--arg npu_compiler_sha "${{ steps.get-npu-sha.outputs.npu-compiler-sha }}" \
--arg llvm_sha "${{ steps.get-llvm-sha.outputs.llvm-sha }}" \
--arg tbb_version "${{ steps.get-tbb-version.outputs.tbb-version }}" \
--arg opencv_sha "${{ steps.read-ocv-sha.outputs.ocv-sha }}" \
--arg omz_sha "${{ steps.read-omz-sha.outputs.omz-sha }}" \
'{
openvino_sha: $openvino_sha,
npu_compiler_sha: $npu_compiler_sha,
llvm_sha: $llvm_sha,
tbb_version: $tbb_version,
opencv_sha: $opencv_sha,
omz_sha: $omz_sha
}' > "$OUTPUT_DIR/build_manifest.json"

MANIFEST_PATH=$(cd "$OUTPUT_DIR" && pwd)/build_manifest.json
echo "Build manifest created at: $MANIFEST_PATH"
echo "build-manifest-path=$MANIFEST_PATH" >> $GITHUB_OUTPUT
cat "$MANIFEST_PATH"
2 changes: 1 addition & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches:
- develop
- 'releases/*'
- releases/**

concurrency:
group: clang-format-${{ github.event_name }}-${{ github.ref_name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches:
- develop
- 'releases/*'
- releases/**
schedule:
- cron: '24 8 * * 6'

Expand Down
38 changes: 36 additions & 2 deletions .github/workflows/job_build_cid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ jobs:
-S ${OPENVINO_REPO} \
-B ${OPENVINO_BUILD_DIR}

- name: Get versions with build manifest
uses: ./npu_actions/.github/actions/versions
id: versions-with-manifest
if: ${{ !steps.cache-restore.outputs.cache-hit }}
with:
build-manifest-dir: ${{ env.CID_PACKAGE_ARTIFACTS_DIR }}
openvino-repo-path: ${{ env.OPENVINO_REPO }}
npu-compiler-repo-path: ${{ env.NPU_COMPILER_REPO }}

- name: CMake build - CiD targets
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: |
Expand All @@ -299,20 +308,45 @@ jobs:
- name: CMake cpack - CiD target
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: |
COMPONENT="CiD"
GENERATOR="Ninja"

cpack -V \
--config "${OPENVINO_BUILD_DIR}/CPackConfig.cmake" \
-C "${CMAKE_BUILD_TYPE}" \
-G "${{ steps.package-params.outputs.cpack-generator }}" \
-B "${CID_PACKAGE_ARTIFACTS_DIR}" \
-D CPACK_COMPONENTS_ALL=CiD \
-D CPACK_CMAKE_GENERATOR=Ninja \
-D CPACK_COMPONENTS_ALL=${COMPONENT} \
-D CPACK_CMAKE_GENERATOR=${GENERATOR} \
-D CPACK_PACKAGE_FILE_NAME="${{ steps.package-name.outputs.cid-package-base-name }}"

- name: CiD Package renaming
run: |
mv "${CID_PACKAGE_ARTIFACTS_DIR}/"*.${{ steps.package-params.outputs.package-extension }} \
"${CID_PACKAGE_ARTIFACTS_DIR}/${{ steps.package-name.outputs.cid-package-full-name }}"

- name: Inject build manifest into CiD package
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: |
PACKAGE_PATH="${CID_PACKAGE_ARTIFACTS_DIR}/${{ steps.package-name.outputs.cid-package-full-name }}"
EXT="${{ steps.package-params.outputs.package-extension }}"
MANIFEST_PATH="${{ steps.versions-with-manifest.outputs.build-manifest-path }}"
MANIFEST_FILENAME=$(basename "${MANIFEST_PATH}")
MANIFEST_DIR=$(dirname "${MANIFEST_PATH}")

PACKAGE_ABS_PATH="$(realpath ${PACKAGE_PATH})"

if [[ "${EXT}" == "zip" ]]; then
echo "Updating ZIP archive using 7-Zip..."
(cd "${MANIFEST_DIR}" && 7z u "${PACKAGE_ABS_PATH}" "${MANIFEST_FILENAME}")
elif [[ "${EXT}" == "tar.gz" ]]; then
echo "Updating TAR.GZ archive using tar..."
gunzip -S .gz "${PACKAGE_ABS_PATH}"
PACKAGE_ABS_PATH="$(realpath ${PACKAGE_PATH%.gz})"
(cd "${MANIFEST_DIR}" && tar -rf "${PACKAGE_ABS_PATH}" "${MANIFEST_FILENAME}")
gzip "${PACKAGE_ABS_PATH}"
fi

- name: Cache CiD artifacts
if: ${{ inputs.build-cache && !steps.cache-restore.outputs.cache-hit }}
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job_build_plugin_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
Build:
name: Build
runs-on: ${{ inputs.build-runner }}
timeout-minutes: 240
timeout-minutes: 360
permissions:
actions: read
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
push:
branches:
- develop
- 'releases/*'
- releases/**

permissions: read-all

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches:
- develop
- 'releases/*'
- releases/**

concurrency:
group: linux-${{ github.event_name }}-${{ github.ref_name }}-ubuntu_22_04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches:
- develop
- 'releases/*'
- releases/**

concurrency:
group: linux-${{ github.event_name }}-${{ github.ref_name }}-ubuntu_24_04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches:
- develop
- 'releases/*'
- releases/**

concurrency:
group: windows-${{ github.event_name }}-${{ github.ref_name }}-2022
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,6 @@ class SCFTilingConvModelOp : public SCFTilingCommonModelOp<ConcreteModel, Concre

class SCFConvOpModel : public SCFTilingConvModelOp<SCFConvOpModel, NCEConvolutionOp> {};

class SCFCompressConvOpModel : public SCFTilingConvModelOp<SCFCompressConvOpModel, NCECompressConvolutionOp> {};

class SCFTilingDepthConvModelOp : public SCFTilingConvModelOp<SCFTilingDepthConvModelOp, NCEDepthConvolutionOp> {
public:
SCFTilingInfo backInferSCFTileInfo(mlir::Operation* operation, mlir::OpBuilder& builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ void vpux::VPU::arch40xx::registerSCFTilingOpsInterfaces(mlir::DialectRegistry&
VPU::NCEAveragePoolOp::attachInterface<vpux::VPU::SCFAvgPoolOpModel>(*ctx);
VPU::NCEMaxPoolOp::attachInterface<vpux::VPU::SCFMaxPoolOpModel>(*ctx);
VPU::NCEConvolutionOp::attachInterface<vpux::VPU::SCFConvOpModel>(*ctx);
VPU::NCECompressConvolutionOp::attachInterface<vpux::VPU::SCFCompressConvOpModel>(*ctx);
VPU::NCEDepthConvolutionOp::attachInterface<vpux::VPU::SCFTilingDepthConvModelOp>(*ctx);
VPU::NCEPermuteOp::attachInterface<vpux::VPU::SCFTilingPermuteModelOp>(*ctx);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,30 +426,3 @@ vpux::VPU::SparsitySupport vpux::VPU::NCECompressConvolutionOp::sparsitySupport(
}
return VPU::SparsitySupport::SPARSE_OUTPUTS & excludeMode;
}

mlir::LogicalResult vpux::VPU::NCECompressConvolutionOp::reifyResultShapes(
mlir::OpBuilder& builder, mlir::ReifiedRankedShapedTypeDims& reifiedReturnShapes) {
// Parse attributes
const auto strides = parseIntArrayAttr<int64_t>(getStrides());

const auto padTop = getPad().getTop().getValue().getSExtValue();
const auto padBottom = getPad().getBottom().getValue().getSExtValue();
const auto padLeft = getPad().getLeft().getValue().getSExtValue();
const auto padRight = getPad().getRight().getValue().getSExtValue();

const auto dataPaddingAbove = SmallVector<int64_t>({padTop, padLeft});
const auto dataPaddingBelow = SmallVector<int64_t>({padBottom, padRight});

const auto rawFilterShape = Shape(parseIntArrayAttr<int64_t>(getRawFilterShape()));
SmallVector<int64_t> kernelSize{rawFilterShape[Dims4D::Filter::KY], rawFilterShape[Dims4D::Filter::KX]};

// Compute output shape using utility
auto outShape = reifyConvPoolTensors(builder, getInput(), getOutput(), getFilter(), kernelSize, strides,
dataPaddingAbove, dataPaddingBelow, getLoc());
if (mlir::failed(outShape)) {
return outShape;
}

reifiedReturnShapes.emplace_back(std::move(outShape.value()));
return mlir::success();
}
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,7 @@ def VPU_NCECompressConvolutionOp :
"doesLayerFitIntoCMX",
"doesLayerChangeOutputAlignmentFitIntoCMX",
"getDistributedTypeForOpOperand"]>,
DeclareOpInterfaceMethods<VPU_SparseOpInterface>,
DeclareOpInterfaceMethods<VPU_VerticalFusionOpInterface>,
DeclareOpInterfaceMethods<ReifyRankedShapedTypeOpInterface>
DeclareOpInterfaceMethods<VPU_SparseOpInterface>
]
> {
let summary = "NCE version of Compressed Convolution layer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,7 @@ vcl_result_t BuildInfo::prepareModel(const uint8_t* modelIR, uint64_t modelIRSiz
throw std::invalid_argument(error_message.str());
}

#ifdef VPUX_DEVELOPER_BUILD
// E#103359: WS is only available in developer builds
restoreWeightsOffsets(model, logger);
#endif // VPUX_DEVELOPER_BUILD

if (enableProfiling) {
stopWatch.stop();
Expand Down
Loading